Add a basic testcase for bogus filename triplet detection
authorPanu Matilainen <pmatilai@redhat.com>
Sat, 28 Jan 2012 16:03:42 +0000 (18:03 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Sat, 28 Jan 2012 16:13:01 +0000 (18:13 +0200)
tests/rpmpython.at

index c7ce1c0..7d0d6c6 100644 (file)
@@ -127,7 +127,7 @@ for e in ts:
 [foo-1.0-1.noarch]
 )
 
-RPMPY_TEST([add bogus package to transaction],[
+RPMPY_TEST([add bogus package to transaction 1],[
 ts = rpm.ts()
 h = rpm.hdr()
 h['name'] = "foo"
@@ -141,6 +141,27 @@ for e in ts:
 [adding package to transaction failed]
 )
 
+RPMPY_TEST([add bogus package to transaction 2],[
+ts = rpm.ts()
+h = rpm.hdr()
+h['name'] = 'foo'
+h['version'] = '1.0'
+h['release'] = '1'
+h['os'] = 'linux'
+h['arch'] = 'noarch'
+h['basenames'] = ['bing', 'bang', 'bong']
+h['dirnames'] = ['/opt' '/flopt']
+h['dirindexes'] = [ 1, 2, 3 ]
+try:
+    ts.addInstall(h, 'foo', 'u')
+except rpm.error, err:
+    myprint(err)
+for e in ts:
+    myprint(e.NEVRA())
+],
+[adding package to transaction failed]
+)
+
 AT_SETUP([database iterators])
 AT_KEYWORDS([python rpmdb])
 AT_CHECK([