Fix remaining unit test failures for repository_tool.py

This commit is contained in:
Vladimir Diaz 2017-08-25 17:25:32 -04:00
parent 15777a309f
commit b7c3b7c198
No known key found for this signature in database
GPG key ID: 5DEE9B97B0E2289A

View file

@ -382,11 +382,9 @@ def test_get_filepaths_in_directory(self):
# Verify the expected filenames. get_filepaths_in_directory() returns
# a list of absolute paths.
metadata_files = repo.get_filepaths_in_directory(metadata_directory)
expected_files = ['1.root.json', '1.root.json.gz', 'root.json',
'targets.json', 'targets.json.gz', 'snapshot.json',
'snapshot.json.gz', 'timestamp.json',
'timestamp.json.gz', 'role1.json', 'role1.json.gz',
'role2.json', 'role2.json.gz']
expected_files = ['1.root.json', 'root.json',
'targets.json', 'snapshot.json',
'timestamp.json', 'role1.json', 'role2.json']
basenames = []
for filepath in metadata_files:
@ -1683,11 +1681,6 @@ def test_load_repository(self):
with open(bad_root_content, 'wb') as file_object:
file_object.write(b'bad')
# Remove the compressed version of role1 to test whether the
# load_repository() complains or not (it logs a message).
role1_path = os.path.join(metadata_directory, 'role1.json.gz')
os.remove(role1_path)
repository = repo_tool.load_repository(repository_directory)
self.assertTrue(isinstance(repository, repo_tool.Repository))