Skip to content

Commit

Permalink
tests: re-enable package cleanup in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
james-garner-canonical committed Dec 3, 2024
1 parent 7666b12 commit c193625
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions tests/integration/test_apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_install_package_from_external_repository():
## apt.add_package(...)
apt.import_key(key)
## if: use implicit write_file
_repo = apt.DebianRepository.from_repo_line(line)
repo = apt.DebianRepository.from_repo_line(line)
apt.update()
repos_after = apt.RepositoryMapping()
## if: don't use implicit write_file
Expand All @@ -113,12 +113,11 @@ def test_install_package_from_external_repository():
## cleanup
apt.remove_package("mongodb-org", autoremove=True) # mongodb-org is a metapackage
assert not get_command_path("mongod")
## FIXME: RepositoryMapping._remove
# repos_after._remove(repo, update_cache=False) # pyright: ignore[reportPrivateUsage]
# assert repo_id not in repos_after
# apt.update()
# repos_clean = apt.RepositoryMapping()
# assert repo_id not in repos_clean
repos_after._remove(repo, update_cache=False) # pyright: ignore[reportPrivateUsage]
assert repo_id not in repos_after
apt.update()
repos_clean = apt.RepositoryMapping()
assert repo_id not in repos_clean


def test_install_higher_version_package_from_external_repository():
Expand Down Expand Up @@ -167,14 +166,10 @@ def test_install_higher_version_package_from_external_repository():
## cleanup
apt.remove_package("inkscape")
assert not get_command_path("inkscape")
## FIXME: RepositoryMapping._remove
# repos_after._remove(repo, update_cache=False) # pyright: ignore[reportPrivateUsage]
# assert repo_id not in repos_after
# apt.update()
# repos_clean = apt.RepositoryMapping()
# assert repo_id not in repos_clean
# repos_clean = repos_after._remove(repo, update_cache=True) # pyright: ignore[reportPrivateUsage]
# assert repo_id not in repos_clean
repos_clean = repos_after._remove( # pyright: ignore[reportPrivateUsage]
repo, update_cache=True
)
assert repo_id not in repos_clean


def test_from_apt_cache_error():
Expand Down

0 comments on commit c193625

Please sign in to comment.