mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
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:
parent
51997cba5d
commit
b7d86eca36
1 changed files with 16 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue