Skip to content

Commit

Permalink
Merge pull request #40 from yftacherzog/add-suffix
Browse files Browse the repository at this point in the history
fix: add extensions to generated repofiles
  • Loading branch information
yftacherzog authored Jan 1, 2024
2 parents 7d9c0ec + 19e7fda commit cb1240d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion generate_compose/odcs_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __call__(self, request_reference: ODCSRequestReferences) -> ODCSResultRefere
urls = request_reference.compose_urls
for url in urls:
with tempfile.NamedTemporaryFile(
delete=False, dir=self.compose_dir_path
delete=False, dir=self.compose_dir_path, suffix=".repo"
) as compose_path:
response = requests.get(url, timeout=10)
response.raise_for_status()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_odcs_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,7 @@ def test_odcs_fetcher(tmp_path: Path, composes: list[str], urls: list[str]) -> N
files_content = [
p.read_text(encoding="utf-8") for p in out.compose_dir_path.iterdir()
]
extensions = [p.suffix for p in out.compose_dir_path.iterdir()]

assert set(composes) == set(files_content)
assert set(extensions) == set([".repo"])

0 comments on commit cb1240d

Please sign in to comment.