Don't redownload the component mapping file

This commit is contained in:
Marco Castelluccio 2020-03-13 19:55:00 +01:00
Родитель 65038ce23a
Коммит 3993e7ec49
2 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -854,6 +854,9 @@ def set_commits_to_ignore(repo_dir, commits):
def download_component_mapping():
global path_to_component
if path_to_component is not None:
return
utils.download_check_etag(
"https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.v2.mozilla-central.latest.source.source-bugzilla-info/artifacts/public/components.json",
"data/component_mapping.json",

Просмотреть файл

@ -328,6 +328,7 @@ def test_download_component_mapping():
repository.download_component_mapping()
assert len(repository.path_to_component) == 0
repository.path_to_component = None
responses.reset()
responses.add(
responses.HEAD,
@ -351,6 +352,13 @@ def test_download_component_mapping():
assert repository.path_to_component["AUTHORS"] == "mozilla.org::Licensing"
assert repository.path_to_component["Cargo.lock"] == "Firefox Build System::General"
responses.reset()
repository.download_component_mapping()
assert len(repository.path_to_component) == 2
assert repository.path_to_component["AUTHORS"] == "mozilla.org::Licensing"
assert repository.path_to_component["Cargo.lock"] == "Firefox Build System::General"
repository.path_to_component = None
responses.reset()
responses.add(
responses.HEAD,