本文整理汇总了Python中appurify.client.AppurifyClient.main方法的典型用法代码示例。如果您正苦于以下问题:Python AppurifyClient.main方法的具体用法?Python AppurifyClient.main怎么用?Python AppurifyClient.main使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appurify.client.AppurifyClient
的用法示例。
在下文中一共展示了AppurifyClient.main方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testPollTimeoutCode
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testPollTimeoutCode(self):
mockRequestGet.count = -20
client = AppurifyClient(api_key="test_key", api_secret="test_secret", test_type="ios_webrobot",
app_src=None,
test_src=None,
url="www.yahoo.com",
timeout_sec=0.2,
poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 3, "Main should execute and return error code")
示例2: testDefaultPollTimeoutCode
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testDefaultPollTimeoutCode(self):
old_env = os.environ.get('APPURIFY_API_TIMEOUT', None)
try:
os.environ['APPURIFY_API_TIMEOUT'] = '0.2'
mockRequestGet.count = -20
client = AppurifyClient(access_token="authenticated", poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 1, "Main should execute and return error code with default timeout")
finally:
if old_env:
os.environ['APPURIFY_API_TIMEOUT'] = str(old_env)
示例3: testMainPass
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testMainPass(self):
mockRequestGet.count = 0
mockRequestGet.passes = 2
mockRequestGet.fails = 0
mockRequestGet.pass_val = True
client = AppurifyClient(api_key="test_key", api_secret="test_secret", test_type="uiautomation",
app_src=__file__, app_src_type='raw',
test_src=__file__, test_src_type='raw',
timeout_sec=2, poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 0, "Main should execute and return pass code")
示例4: main
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def main():
""" main program
"""
for i in xrange(1,len(sys.argv)):
print "File: %s"%sys.argv[i]
params = {}
if (len(sys.argv)>0):
params = parse_input(sys.argv[1])
# print params
client = AppurifyClient(**params)
sys.exit(client.main())
示例5: testMainFail
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testMainFail(self):
mockRequestGet.count = 0
mockRequestGet.passes = 1
mockRequestGet.fails = 1
mockRequestGet.exception = 0
mockRequestGet.pass_val = False
client = AppurifyClient(api_key="test_key", api_secret="test_secret", test_type="uiautomation",
app_src=__file__, app_src_type='raw',
test_src=__file__, test_src_type='raw',
timeout_sec=2, poll_every=0.1, device_type_id="137")
result_code = client.main()
self.assertEqual(result_code, 1, "Main should execute and return fail code")
示例6: testMainPassUrl
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testMainPassUrl(self):
mockRequestGet.count = 0
mockRequestGet.passes = 2
mockRequestGet.fails = 0
mockRequestGet.pass_val = True
client = AppurifyClient(api_key="test_key", api_secret="test_secret", test_type="ios_webrobot",
app_src=None,
test_src=None,
url="www.yahoo.com",
timeout_sec=2, poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 0, "Main should execute and return pass code")
示例7: testDefaultPollTimeoutCode
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testDefaultPollTimeoutCode(self):
old_env = os.environ.get('APPURIFY_API_TIMEOUT', None)
try:
os.environ['APPURIFY_API_TIMEOUT'] = '0.2'
mockRequestGet.count = -20
client = AppurifyClient(api_key="test_key", api_secret="test_secret", test_type="ios_webrobot",
app_src=None,
test_src=None,
url="www.yahoo.com",
poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 3, "Main should execute and return error code with default timeout")
finally:
if old_env:
os.environ['APPURIFY_API_TIMEOUT'] = str(old_env)
示例8: testPollTimeoutCode
# 需要导入模块: from appurify.client import AppurifyClient [as 别名]
# 或者: from appurify.client.AppurifyClient import main [as 别名]
def testPollTimeoutCode(self):
mockRequestGet.count = -20
client = AppurifyClient(access_token="authenticated", timeout_sec=0.2, poll_every=0.1)
result_code = client.main()
self.assertEqual(result_code, 1, "Main should execute and return error code")