Fix unit test failure in test_roledb.py

Ensure roledb is empty prior to running the test cases.  roledb.py may have been modified by other unit tests that did not properly clean up.
This commit is contained in:
vladdd 2013-09-11 12:36:44 -04:00
parent 51997cba5d
commit b7d86eca36

View file

@ -38,7 +38,7 @@
class TestRoledb(unittest.TestCase):
def setUp(self):
pass
pass
@ -403,6 +403,21 @@ def _test_rolename(self, test_function):
def setUpModule():
# setUpModule is called before any test cases run.
# Ensure the roledb has not been modified by a previous test, which may
# affect assumptions (i.e., empty roledb) made by the tests cases in this
# unit test.
tuf.roledb.clear_roledb()
def tearDownModule():
# tearDownModule is called after all the tests have run.
# Ensure we clean up roledb. Courtesy is contagious, and it begins with
# test_roledb.py.
tuf.roledb.clear_roledb()
# Run the unit tests.
if __name__ == '__main__':
unittest.main()