MCPcopy Create free account
hub / github.com/cztomczak/cefpython / check_auto_asserts

Function check_auto_asserts

unittests/_common.py:76–100  ·  view source on GitHub ↗
(test_case, objects)

Source from the content-addressed store, hash-verified

74
75
76def check_auto_asserts(test_case, objects):
77 # Check if js code completed
78 test_case.assertTrue(g_js_code_completed)
79
80 # Automatic check of asserts in handlers and in external
81 for obj in objects:
82 test_for_True = False # Test whether asserts are working correctly
83 for key, value in obj.__dict__.items():
84 if key == "test_for_True":
85 test_for_True = value
86 continue
87 if "_True" in key:
88 test_case.assertTrue(value, "Check assert: " +
89 obj.__class__.__name__ + "." + key)
90 subtest_message(obj.__class__.__name__ + "." +
91 key.replace("_True", "") +
92 " ok")
93 elif "_False" in key:
94 test_case.assertFalse(value, "Check assert: " +
95 obj.__class__.__name__ + "." + key)
96 subtest_message(obj.__class__.__name__ + "." +
97 key.replace("_False", "") +
98 " ok")
99 if "test_for_True" in obj.__dict__.keys():
100 test_case.assertTrue(test_for_True)
101
102
103class DisplayHandler(object):

Callers 2

test_osrMethod · 0.85
test_mainMethod · 0.85

Calls 1

subtest_messageFunction · 0.85

Tested by 2

test_osrMethod · 0.68
test_mainMethod · 0.68