Skip to content

Commit

Permalink
fix: add Date and hash fields to tests that create repositories (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfect5th authored Aug 20, 2024
1 parent b8a0987 commit 22704f2
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions landscape/client/package/tests/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,9 @@ def test_detect_packages_from_security_pocket(self):
release_path = os.path.join(self.repository_dir, "Release")
with open(release_path, "w") as release:
release.write(
"Suite: {}-security".format(os_release_info["code-name"]),
f"Suite: {os_release_info['code-name']}-security\n"
"Date: Sat, 02 Jul 2016 05:20:50 +0000\n"
"MD5Sum: deadbeef"
)

self.store.set_hash_ids({HASH1: 1, HASH2: 2, HASH3: 3})
Expand Down Expand Up @@ -1246,7 +1248,9 @@ def test_detect_packages_changes_with_backports(self):
release_path = os.path.join(self.repository_dir, "Release")
with open(release_path, "w") as release:
release.write(
"Suite: {}-backports".format(os_release_info["code-name"]),
f"Suite: {os_release_info['code-name']}-backports\n"
"Date: Sat, 02 Jul 2016 05:20:50 +0000\n"
"MD5Sum: deadbeef"
)

self.store.set_hash_ids({HASH1: 1, HASH2: 2, HASH3: 3})
Expand All @@ -1269,7 +1273,11 @@ def test_detect_packages_changes_with_backports_others(self):

release_path = os.path.join(self.repository_dir, "Release")
with open(release_path, "w") as release:
release.write("Suite: my-personal-backports")
release.write(
"Suite: my-personal-backports"
"Date: Sat, 02 Jul 2016 05:20:50 +0000\n"
"MD5Sum: deadbeef"
)

self.store.set_hash_ids({HASH1: 1, HASH2: 2, HASH3: 3})

Expand Down Expand Up @@ -1306,11 +1314,17 @@ def test_detect_packages_changes_with_backports_both(self):
official_release_path = os.path.join(self.repository_dir, "Release")
with open(official_release_path, "w") as release:
release.write(
"Suite: {}-backports".format(os_release_info["code-name"]),
f"Suite: {os_release_info['code-name']}-backports\n"
"Date: Sat, 02 Jul 2016 05:20:50 +0000\n"
"MD5Sum: deadbeef"
)
unofficial_release_path = os.path.join(other_backport_dir, "Release")
with open(unofficial_release_path, "w") as release:
release.write("Suite: my-personal-backports")
release.write(
"Suite: my-personal-backports\n"
"Date: Sat, 02 Jul 2016 05:20:50 +0000\n"
"MD5Sum: deadbeef"
)

self.store.set_hash_ids({HASH1: 1, HASH2: 2, HASH3: 3})

Expand Down

0 comments on commit 22704f2

Please sign in to comment.