• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python mpx_test.DefaultTestFixture类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mpx_test.DefaultTestFixture的典型用法代码示例。如果您正苦于以下问题:Python DefaultTestFixture类的具体用法?Python DefaultTestFixture怎么用?Python DefaultTestFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DefaultTestFixture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
     server_socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
     server_socket.bind(('localhost',0)) # Bind to any available port on
                                         # localhost.
     server_socket.listen(5)
     sockname = server_socket.getsockname()
     ##
     # Socket ready to accept "eWebConnect" Alarm messages.
     self.server_socket = server_socket
     ##
     # The "eWebConnect" host.
     self.sever_address = sockname[0]
     ##
     # The "eWebConnect" post.
     self.server_port = sockname[1]
     self.new_node_tree()
     root = as_internal_node('/')
     self.configure({'name':'Test Case', 'parent':'/'})
     client = EWebConnectAlarmClient()
     client.configure({'name':'eWebConnect', 'parent':self,
                       'host':'localhost',
                       'port':self.server_port})
     as_internal_node('/').start()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:26,代码来源:_test_case_ewebconnect.py


示例2: setUp

 def setUp(self):
     mpx.service.session.SessionManager.PASSWD_FILE = (
         os.path.join(os.path.dirname(__file__), 'passwd.test')
         )
     DefaultTestFixture.setUp(self)
     self.config = {}
     lo = []
     lr = {}
     lr['alias'] = 'default'
     lr['class'] = 'mpx.lib.xmlrpc.XMLRPC_DefaultObject'
     lr['lifetime'] = 'Request'
     lo.append(lr)
     lr = {}
     lr['alias'] = 'rna_xmlrpc'
     lr['class'] = 'mpx.lib.xmlrpc.rna_xmlrpc.RNA_XMLRPC_Handler'
     lr['lifetime'] = 'Runtime'
     lo.append(lr)
     config = {}
     config['name'] = 'XMLRPC_Handler'
     config['parent'] = None
     config['module'] = ''
     config['deployed_objects'] = lo
     self.handler = XMLRPC_Handler()
     self.handler.configure(config)
     root = as_internal_node('/')
     self.new_node_tree()
     as_internal_node('/').start()
     self._session = as_internal_node(
         '/services/session_manager'
         ).create('mpxadmin', 'mpxadmin')
     return
开发者ID:mcruse,项目名称:monotone,代码行数:31,代码来源:_test_case_XMLRPC.py


示例3: tearDown

 def tearDown(self):
     try:
         self.root.prune()
         self.root = None
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_node.py


示例4: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     self.lock = Lock()
     self.pool = ThreadPool(3)
     self.queue = Queue()
     self.simple_action_counter = 0
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_thread_pool.py


示例5: tearDown

 def tearDown(self):
     try:
         self._circular.close()
         del(self._circular)
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_data.py


示例6: setUp

    def setUp(self):
        global debug
        
        DefaultTestFixture.setUp(self)

        self.case = 100
        
        
        # Set up defaults
        self.port = 80
        self._username = 'mpxadmin'
        self._password = 'mpxadmin'
        self.hostname = 'bubba'
        
        self.nodeurl = '/interfaces/eth1/mehtatech_ied_protocol'

        # Override as needed
        #self.hostname = 'localhost'
        #self.port = 8080

        self.port = 443
        
        self.xmlrpcurl = 'https://%s:%s/xmlrpc' % (self.hostname, self.port)

        self.server = xmlrpclib.Server(self.xmlrpcurl, None, None, debug)
            
        # Authenticate with the server and get back a session ID
        self.session = self.server.rna_xmlrpc2.create_session(self._username,
                                                              self._password)
开发者ID:mcruse,项目名称:monotone,代码行数:29,代码来源:_test_case_other.py


示例7: __init__

 def __init__(self, other):
     DefaultTestFixture.__init__(self, other)
     self.eth0 = None
     self.ip = None
     self.server = None
     self.client = None
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_client.py


示例8: tearDown

 def tearDown(self):
     try:
         if hasattr(self, 'seq'):
             del self.seq
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_periodic_delta_column.py


示例9: __init__

 def __init__(self, *args, **kw):
     DefaultTestFixture.__init__(self, *args,**kw)
     EventConsumerMixin.__init__(self, self.change_of_value)
     self.__event_lock = Lock()
     self.__event_updated_values = {}
     self._cov_counter = 0
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_subscription_manager.py


示例10: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     f = StringIO() # A file-like object.
     f.write(file_text)
     f.seek(0) # Rewind the file.
     self.file_object = f
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_properties.py


示例11: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     self.__event_updated_values = {}
     self.new_node_tree()
     root = as_internal_node('/')
     self._cov_counter = 0
     GetException().configure({'name':'exception', 'parent':'/services'})
     SUBSCRIPTION_MANAGER.configure({'debug':0,
                                     '_normal_pool_size':2,
                                     '_slow_pool_size':2,
                                     '_prime_pool_size':2,
                                     '_minimum_poll_interval':0.001,
                                     '_slow_poll_threshold':0.500,
                                     }
                                    )
     for i in range(0,10):
         f = FastNode()
         f.configure({'parent':root, 'name':"FastNode-%03d"%i})
         s = SlowNode()
         s.configure({'parent':root, 'name':"SlowNode-%03d"%i})
         e = ErrorNode()
         e.configure({'parent':root, 'name':"ErrorNode-%03d"%i})
         b = BatchNode(i & 1)
         b.configure({'parent':root, 'name':"BatchNode-%03d"%i})
     root.start()
     return
开发者ID:mcruse,项目名称:monotone,代码行数:26,代码来源:_test_case_subscription_manager.py


示例12: tearDown

 def tearDown(self):
     try:
         if hasattr(self,'collector'):
             del self.collector
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_collector.py


示例13: tearDown

 def tearDown(self):
     try:
         if hasattr(self,'server'):
             del self.server
         if hasattr(self,'client'):
             del self.client
         if hasattr(self,'lhc'):
             del self.lhc
         if hasattr(self,'lhs'):
             self.lhs.server.server_thread.should_die()
             self.lhs.server.close_connection()
             kill_a_server(self.lhs.server.server_thread)
             while self.lhs.server.server_thread.isAlive():
                 time.sleep(0.01)
             # @fixme WHY IS THIS COMMENTED?
             #self.lhs.server.server_thread.exit()
             del self.lhs.server.server_thread
             del self.lhs.server
             del self.lhs
         if hasattr(self,'ip'):
             del self.ip
         if hasattr(self,'eth0'):
             del self.eth0
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:26,代码来源:_test_case_client.py


示例14: tearDown

 def tearDown(self):
     self.user_manager.stop()
     self.user_manager = None
     os.unlink(self.passwd_file)
     self.passwd_file = None
     DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:7,代码来源:_test_case_user_manager.py


示例15: tearDown

 def tearDown(self):
     try:
         self.rna_target._abort = True
         self.root.prune()
         self.root = None
     finally:
         DefaultTestFixture.tearDown(self)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:_test_case_rna.py


示例16: __init__

 def __init__(self, *args, **kw):
     DefaultTestFixture.__init__(self, *args, **kw)
     self.assertions_enabled = 0
     try:
         assert False
     except AssertionError:
         self.assertions_enabled = 1
     return
开发者ID:mcruse,项目名称:monotone,代码行数:8,代码来源:_test_case_node_decorator.py


示例17: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     self.user_manager = mpx.lib.factory(
         'mpx.service.user_manager.UserManager'
         )
     self.user_manager.configure({'name':'User Manager','parent':None})
     self.passwd_file = self.new_passwd_file()
     f = open(self.passwd_file,'r')
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:_test_case_user_manager.py


示例18: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     self.data = []
     for x in range(1,20):
         entry = {}
         entry['timestamp'] = time.time()
         entry['column-A'] = x
         self.data.append(entry)
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:_test_case_xml_formatter.py


示例19: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     self.log = log.TrimmingLog('trimming_test')
     # __init__(self, name = None, position = None, sort_order = None):
     self.c2 = log.ColumnConfiguration('c2', 1, 'none')
     self.c3 = log.ColumnConfiguration('c3', 2, 'none')
     self.c4 = log.ColumnConfiguration('c4', 3, 'none')
     self.timestamp = log.ColumnConfiguration('timestamp', 0, 'ascending')
     return
开发者ID:mcruse,项目名称:monotone,代码行数:9,代码来源:_test_case_trimming_log.py


示例20: setUp

 def setUp(self):
     DefaultTestFixture.setUp(self)
     global _failed
     global _callback_stream
     global _reason
     global _callback_count
     _callback_count = 0
     _failed = None
     _callback_stream = None
     _reason = ''
开发者ID:mcruse,项目名称:monotone,代码行数:10,代码来源:_test_case_stream.py



注:本文中的mpx_test.DefaultTestFixture类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mqttcli.MqttClient类代码示例发布时间:2022-05-27
下一篇:
Python mpx_test.main函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap