summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-12-03 00:56:48 +0100
committerDan McGee <dan@archlinux.org>2007-12-03 00:56:48 +0100
commite8eff3ef97e30ec64fbb62e502ed24fe5baceca0 (patch)
tree66851e2e63aba2c3c6781789834b3c84bdaa6d34
parent0b6d73a5b4931519ee40646aa9093148f4571cf0 (diff)
downloadpacman-e8eff3ef97e30ec64fbb62e502ed24fe5baceca0.tar.gz
pacman-e8eff3ef97e30ec64fbb62e502ed24fe5baceca0.tar.xz
Add more pactests to increase code coverage
These new tests test the following ops at least once: -Ss, -Si, -Sl, -Sp, -Qs, -Qi, -T Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--pactest/tests/deptest001.py20
-rw-r--r--pactest/tests/query001.py2
-rw-r--r--pactest/tests/query002.py10
-rw-r--r--pactest/tests/query003.py10
-rw-r--r--pactest/tests/query004.py10
-rw-r--r--pactest/tests/sync1100.py11
-rw-r--r--pactest/tests/sync1101.py11
-rw-r--r--pactest/tests/sync1102.py12
-rw-r--r--pactest/tests/sync1103.py11
9 files changed, 96 insertions, 1 deletions
diff --git a/pactest/tests/deptest001.py b/pactest/tests/deptest001.py
new file mode 100644
index 00000000..db0b7684
--- /dev/null
+++ b/pactest/tests/deptest001.py
@@ -0,0 +1,20 @@
+self.description = "test deptest (-T) functionality"
+
+sp1 = pmpkg("pkg1")
+sp1.depends = ["dep"]
+self.addpkg2db("sync", sp1)
+
+sp1dep = pmpkg("dep")
+self.addpkg2db("sync", sp1dep)
+
+sp2 = pmpkg("pkg2")
+self.addpkg2db("sync", sp2)
+
+lp2 = pmpkg("pkg2")
+self.addpkg2db("local", lp2)
+
+self.args = "-T pkg1 pkg2"
+
+self.addrule("PACMAN_RETCODE=127")
+self.addrule("PACMAN_OUTPUT=pkg1")
+self.addrule("!PACMAN_OUTPUT=pkg2")
diff --git a/pactest/tests/query001.py b/pactest/tests/query001.py
index 315af84a..8faf0e15 100644
--- a/pactest/tests/query001.py
+++ b/pactest/tests/query001.py
@@ -7,4 +7,4 @@ self.addpkg2db("local", p)
self.args = "-Q %s" % p.name
self.addrule("PACMAN_RETCODE=0")
-self.addrule("PACMAN_OUTPUT=foobar")
+self.addrule("PACMAN_OUTPUT=%s" % p.name)
diff --git a/pactest/tests/query002.py b/pactest/tests/query002.py
new file mode 100644
index 00000000..830936b4
--- /dev/null
+++ b/pactest/tests/query002.py
@@ -0,0 +1,10 @@
+self.description = "Query info on a package"
+
+p = pmpkg("foobar")
+p.files = ["bin/foobar"]
+self.addpkg2db("local", p)
+
+self.args = "-Qi %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % p.name)
diff --git a/pactest/tests/query003.py b/pactest/tests/query003.py
new file mode 100644
index 00000000..ea113081
--- /dev/null
+++ b/pactest/tests/query003.py
@@ -0,0 +1,10 @@
+self.description = "Query search for a package"
+
+p = pmpkg("foobar")
+p.files = ["bin/foobar"]
+self.addpkg2db("local", p)
+
+self.args = "-Qs %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % p.name)
diff --git a/pactest/tests/query004.py b/pactest/tests/query004.py
new file mode 100644
index 00000000..8faf0e15
--- /dev/null
+++ b/pactest/tests/query004.py
@@ -0,0 +1,10 @@
+self.description = "Query a package"
+
+p = pmpkg("foobar")
+p.files = ["bin/foobar"]
+self.addpkg2db("local", p)
+
+self.args = "-Q %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % p.name)
diff --git a/pactest/tests/sync1100.py b/pactest/tests/sync1100.py
new file mode 100644
index 00000000..1f8fa057
--- /dev/null
+++ b/pactest/tests/sync1100.py
@@ -0,0 +1,11 @@
+self.description = "Get info on package from a sync db"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-Si %s" % sp.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % sp.name)
diff --git a/pactest/tests/sync1101.py b/pactest/tests/sync1101.py
new file mode 100644
index 00000000..ba2ad44f
--- /dev/null
+++ b/pactest/tests/sync1101.py
@@ -0,0 +1,11 @@
+self.description = "Search for package from a sync db"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-Ss %s" % sp.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % sp.name)
diff --git a/pactest/tests/sync1102.py b/pactest/tests/sync1102.py
new file mode 100644
index 00000000..3a27238f
--- /dev/null
+++ b/pactest/tests/sync1102.py
@@ -0,0 +1,12 @@
+self.description = "Get URL on package from a sync db"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-Sp %s" % sp.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % sp.name)
+self.addrule("PACMAN_OUTPUT=file://")
diff --git a/pactest/tests/sync1103.py b/pactest/tests/sync1103.py
new file mode 100644
index 00000000..052c7236
--- /dev/null
+++ b/pactest/tests/sync1103.py
@@ -0,0 +1,11 @@
+self.description = "Get package list from sync dbs"
+
+sp = pmpkg("dummy")
+sp.files = ["bin/dummy",
+ "usr/man/man1/dummy.1"]
+self.addpkg2db("sync", sp)
+
+self.args = "-Sl"
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PACMAN_OUTPUT=%s" % sp.name)