begin to splitup test cases
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
06d174f750
commit
7d290a7755
1 changed files with 26 additions and 4 deletions
30
test.py
30
test.py
|
@ -142,9 +142,7 @@ class Config(unittest.TestCase):
|
||||||
manifest_fd.close()
|
manifest_fd.close()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print("a")
|
|
||||||
self.config.run_initial_manifest()
|
self.config.run_initial_manifest()
|
||||||
print("b")
|
|
||||||
except cdist.Error:
|
except cdist.Error:
|
||||||
failed = True
|
failed = True
|
||||||
else:
|
else:
|
||||||
|
@ -166,6 +164,30 @@ class UI(unittest.TestCase):
|
||||||
for cmd in cdist_commands:
|
for cmd in cdist_commands:
|
||||||
self.assertEqual(subprocess.call([cdist_exec_path, "config", "localhost"]), 0)
|
self.assertEqual(subprocess.call([cdist_exec_path, "config", "localhost"]), 0)
|
||||||
|
|
||||||
|
|
||||||
|
def almost_all_tests():
|
||||||
|
suite = unittest.TestSuite([
|
||||||
|
unittest.TestLoader().loadTestsFromTestCase(Config),
|
||||||
|
unittest.TestLoader().loadTestsFromTestCase(Exec)])
|
||||||
|
|
||||||
|
return suite
|
||||||
|
|
||||||
|
def all_tests():
|
||||||
|
suite = unittest.defaultTestLoader
|
||||||
|
return suite
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
result = unittest.TestResult()
|
||||||
|
# only run some tests, when giving -a -> stuff that usually breaks
|
||||||
|
if len(sys.argv) >= 2:
|
||||||
|
if sys.argv[1] == "-a":
|
||||||
|
suite = all_tests();
|
||||||
|
else:
|
||||||
|
sys.exit(1)
|
||||||
|
else:
|
||||||
|
suite = almost_all_tests();
|
||||||
|
|
||||||
|
# suite.run(result)
|
||||||
|
# unittest.main()
|
||||||
|
# unittest.TextTestRunner().run(suite)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue