Fix unit tests for _target_matchese_path_pattern()

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
This commit is contained in:
Vladimir Diaz 2017-12-13 15:51:33 -05:00
parent f40a6d58b7
commit fd685bf22c
No known key found for this signature in database
GPG key ID: 5DEE9B97B0E2289A

View file

@ -1803,13 +1803,16 @@ def test__init__(self):
def test_paths_match_target(self):
def test__target_matches_path_pattern(self):
map_file = os.path.join(self.client_directory, 'map.json')
multi_repo_updater = updater.MultiRepoUpdater(map_file)
paths = ['foo*.tgz', 'bar*.tgz', 'file1.txt']
self.assertTrue(multi_repo_updater.paths_match_target(paths, 'bar-1.0.tgz'))
self.assertTrue(multi_repo_updater.paths_match_target(paths, 'file1.txt'))
self.assertFalse(multi_repo_updater.paths_match_target(paths, 'baz-1.0.tgz'))
self.assertTrue(
multi_repo_updater._target_matches_path_pattern('bar-1.0.tgz', paths))
self.assertTrue(
multi_repo_updater._target_matches_path_pattern('file1.txt', paths))
self.assertFalse(
multi_repo_updater._target_matches_path_pattern('baz-1.0.tgz', paths))