inst_tester: add is_pkg_in_testing

ubuntu/rebased
Paul Gevers 7 years ago
parent 20a64cadef
commit 713b98ad6b
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -162,6 +162,14 @@ class InstallabilityTester(object):
"""
return not self._testing.isdisjoint(pkgs)
def is_pkg_in_testing(self, pkg):
"""Test if the package of is in testing
:param pkgs: A package id (as defined in the constructor)
:return: True if the pkg is currently in testing
"""
return pkg in self._testing
def add_testing_binary(self, pkg_id):
"""Add a binary package to "testing"

@ -31,6 +31,8 @@ class TestInstTester(unittest.TestCase):
universe.remove_testing_binary(pkg_perl)
assert not universe.any_of_these_are_in_testing((pkg_perl,))
assert universe.any_of_these_are_in_testing((pkg_lintian,))
assert not universe.is_pkg_in_testing(pkg_perl)
assert universe.is_pkg_in_testing(pkg_lintian)
assert not universe.is_installable(pkg_lintian)
assert not universe.is_installable(pkg_perl)
universe.add_testing_binary(pkg_perl)

Loading…
Cancel
Save