本文整理汇总了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;未经允许,请勿转载。 |
请发表评论