summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2008-08-05 11:36:13 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2008-08-05 11:36:13 +0200
commit5204dc7d2975121f529802ec403134502d6d4e45 (patch)
tree964c562361f6f276740d47baf9e247771751e009 /tests
parent91e65ee1efd73fdbf507c2683bc6cc64fee9b37c (diff)
parent1d96f36591c56798021c4e33d01a781507592add (diff)
downloadpython-apt-5204dc7d2975121f529802ec403134502d6d4e45.tar.gz
* python/cache.cc:
- fix GetCandidateVer() reporting incorrect versions after SetCandidateVer() was used. Thanks to Julian Andres Klode for the test-case (LP: #237372) * python/apt_instmodule.cc: - do not change working dir in debExtractArchive() (LP: #184093) * apt/cache.py: - support "in" in apt.Cache() (LP: #251587)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_debextract.py13
-rw-r--r--tests/test_extract_archive.py10
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_debextract.py b/tests/test_debextract.py
new file mode 100755
index 00000000..53241e92
--- /dev/null
+++ b/tests/test_debextract.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import apt_inst
+import sys
+
+def Callback(What,Name,Link,Mode,UID,GID,Size,MTime,Major,Minor):
+ print "%s '%s','%s',%u,%u,%u,%u,%u,%u,%u" % (
+ What,Name,Link,Mode,UID,GID,Size, MTime, Major, Minor)
+
+member = "data.tar.lzma"
+if len(sys.argv) > 2:
+ member = sys.argv[2]
+apt_inst.debExtract(open(sys.argv[1]), Callback, member)
diff --git a/tests/test_extract_archive.py b/tests/test_extract_archive.py
new file mode 100644
index 00000000..ce202b06
--- /dev/null
+++ b/tests/test_extract_archive.py
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+import apt
+import apt_inst
+import os
+import sys
+
+print os.getcwd()
+apt_inst.debExtractArchive(open(sys.argv[1]), "/tmp/")
+print os.getcwd()