diff options
| author | Michael Vogt <mvo@debian.org> | 2013-06-06 18:28:54 +0200 |
|---|---|---|
| committer | Michael Vogt <mvo@debian.org> | 2013-06-06 18:28:54 +0200 |
| commit | 7bf32e0194819f292ae3012e00ba0a96c2c30852 (patch) | |
| tree | fa23727cb873cda72f96f8ceb2e0d22711f451a0 | |
| parent | 76f6e07ec8c08c011ee9ab8f46d77972e42e73cf (diff) | |
| download | python-apt-7bf32e0194819f292ae3012e00ba0a96c2c30852.tar.gz | |
add support for "key in apt.debfile.DebPackage" (closes: #710541)
| -rw-r--r-- | apt/debfile.py | 3 | ||||
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | tests/test_debfile.py | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/apt/debfile.py b/apt/debfile.py index 1ebbea32..adf9b348 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -72,6 +72,9 @@ class DebPackage(object): def __getitem__(self, key): return self._sections[key] + def __contains__(self, key): + return key in self._sections + @property def filelist(self): """return the list of files in the deb.""" diff --git a/debian/changelog b/debian/changelog index fb77504a..917121be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ python-apt (0.8.9.1) UNRELEASED; urgency=low [ Julian Andres Klode ] * Update the Vcs fields to use Vcs-Git with git protocol, and gitweb for Vcs-Browser + + [ Colin Watson ] + * add support for "key in apt.debfile.DebPackage" (closes: #710541) -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 16 May 2013 16:46:24 +0200 diff --git a/tests/test_debfile.py b/tests/test_debfile.py index 75c46966..2ae73a45 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -133,6 +133,10 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading # we need to support python2.6 self.assertTrue(raised) + def test_contains(self): + deb = apt.debfile.DebPackage("./data/test_debs/data-tar-xz.deb") + self.assertTrue("Package" in deb) + if __name__ == "__main__": #logging.basicConfig(level=logging.DEBUG) |
