本文整理汇总了Python中pytestemb.add_test_case函数的典型用法代码示例。如果您正苦于以下问题:Python add_test_case函数的具体用法?Python add_test_case怎么用?Python add_test_case使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_test_case函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deep_02
import pytestemb as test
def deep_02():
0/0
def deep_01():
deep_02()
def deep_00():
deep_01()
if __name__ == "__main__":
test.add_test_case(deep_00)
test.run_script()
示例2: stop
def stop():
if test.get_case_name() == "cleanup":
pass
else:
raise Exception("")
if __name__ == "__main__":
test.set_setup(start)
test.add_test_case(a)
test.add_test_case(b)
test.set_cleanup(stop)
test.run_script()
示例3: start
def start():
pass
def stop():
pass
if __name__ == "__main__":
test.set_setup(start)
test.add_test_case(level_3)
test.add_test_case(level_2)
test.add_test_case(level_1)
test.set_cleanup(stop)
test.run_script()
示例4:
@coverage ::
@warning ::
"""
test.assert_true(1==1, "1==1")
test.assert_true(1==1, "1==1")
if __name__ == "__main__":
test.add_test_case(case_01)
test.add_test_case(case_02)
test.run_script()
# import cProfile
# cProfile.run('test.run_script()')
#
示例5: test_assert_equal
def test_assert_equal():
for val1 in vector:
for val2 in vector:
test.assert_equal(val1, val2, "equal")
if __name__ == "__main__":
test.add_trace(["txt"])
test.add_test_case(test_assert)
test.add_test_case(test_trace)
test.add_test_case(test_assert_equal)
test.run_script()
示例6: start
def start():
pass
def stop():
pass
if __name__ == "__main__":
test.set_setup(start)
test.add_test_case(case_0)
test.add_test_case(case_1)
test.set_cleanup(stop)
test.run_script()
示例7: start
test.assert_equal(1, 1)
test.assert_true(1==1, "1==1")
def start():
pass
def stop():
pass
if __name__ == "__main__":
test.add_test_case(defaultValue)
test.set_cleanup(stop)
test.set_cleanup(stop)
test.run_script()
示例8: case_msg_txt
def case_msg_txt():
test.assert_true(1==1, "1==1")
def case_msg_int():
test.assert_true(1==1, 1)
if __name__ == "__main__":
test.add_test_case(case_msg_txt)
test.add_test_case(case_msg_int)
test.run_script()
示例9:
test.trace_json(obj)
v = random.randint(0, 10)
obj = {"time_perf":(35 + v), "product":"C"}
test.trace_json(obj)
v = random.randint(0,80)
obj = {"time_perf":v, "product":"D"}
test.trace_json(obj)
if __name__ == "__main__":
test.add_trace(["txt", "logstash", "octopylog"])
test.add_test_case(test_json)
test.run_script()
示例10: range
"""
@goal : -
@coverage : -
"""
for i in range(0,10):
test.trace_script("%d" % i)
time.sleep(60)
if __name__ == "__main__":
test.set_doc(__doc__)
test.add_test_case(wait_long_time)
test.run_script()
示例11: test_parsing
def test_parsing():
import sys
sys.stdout.write("ASSERT_OK={'info':'assert_ok_01'")
if __name__ == "__main__":
test.add_test_case(test_parsing)
test.run_script()
示例12: case_09
test.assert_true(1==1, "1==1")
test.assert_true(1==2, "1==2")
def case_09():
test.assert_true(1==1, "1==1")
test.assert_true(1==2, "1==2")
def case_10():
test.assert_true(1==1, "1==1")
test.assert_true(1==2, "1==2")
if __name__ == "__main__":
test.add_test_case(case_01)
test.add_test_case(case_02)
test.add_test_case(case_03)
test.add_test_case(case_04)
test.add_test_case(case_05)
test.add_test_case(case_06)
test.add_test_case(case_07)
test.add_test_case(case_08)
test.add_test_case(case_09)
test.add_test_case(case_10)
test.run_script()
示例13: range
for i in range(0,32):
test.trace_script("Loop %d" % i)
echo.send("AABB%d" % i)
rx = echo.receive()
test.assert_true(rx=="AABB%d" % i)
if __name__ == "__main__":
test.set_setup(setup)
test.add_test_case(check_io)
test.run_script()
示例14: test_warning
# -*- coding: UTF-8 -*-
import pytestemb as test
import mock
def test_warning():
test.warning("warm")
if __name__ == "__main__":
test.add_trace(["txt", "logstash", "octopylog"])
test.add_test_case(test_warning)
test.run_script()
示例15: test_exception1
import pytestemb as test
def test_exception1():
raise Exception("abcééé".encode("latin_1"))
def test_exception2():
raise Exception("\xC3")
def test_exception3():
s = ""
s += "\xC3"
if __name__ == "__main__":
test.add_trace(["txt"])
test.add_test_case(test_exception1)
test.add_test_case(test_exception2)
test.add_test_case(test_exception3)
test.run_script()