summaryrefslogtreecommitdiff
path: root/tests/rpmpython.at
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-12-16 17:18:21 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-12-16 17:18:21 +0200
commit8acb7f7c1d8d7e93a04ca214f98660a40ee2b319 (patch)
treefaee9f83e346cfee81d291ef99b3a07ff6ebe4fd /tests/rpmpython.at
parentbf37b06d19b769572c06a667b31164d6ed279155 (diff)
downloadlibrpm-tizen-8acb7f7c1d8d7e93a04ca214f98660a40ee2b319.tar.gz
librpm-tizen-8acb7f7c1d8d7e93a04ca214f98660a40ee2b319.tar.bz2
librpm-tizen-8acb7f7c1d8d7e93a04ca214f98660a40ee2b319.zip
Move python test-suite macros to local.at, rename
- We'll want to use these in other test parts than just python. Make available everywhere and use "namespace" to avoid potential future clashes.
Diffstat (limited to 'tests/rpmpython.at')
-rw-r--r--tests/rpmpython.at25
1 files changed, 4 insertions, 21 deletions
diff --git a/tests/rpmpython.at b/tests/rpmpython.at
index 8651ca540..e314615a5 100644
--- a/tests/rpmpython.at
+++ b/tests/rpmpython.at
@@ -3,30 +3,13 @@
AT_BANNER([Python bindings])
-m4_define([RUNPY],[
-cat << EOF > test.py
-import rpm, sys
-def myprint(msg):
- sys.stdout.write('%s\n' % msg)
-$1
-EOF
-python test.py
-])
-
-m4_define([PY_CHECK],[
-AT_SETUP([$1])
-AT_KEYWORDS([python])
-AT_CHECK([RUNPY([[$2]])], [], [$3], [$4])
-AT_CLEANUP
-])
-
-PY_CHECK([module import],[
+RPMPY_CHECK([module import],[
myprint(rpm.__version__)
],
[AT_PACKAGE_VERSION]
)
-PY_CHECK([basic header manipulation],[
+RPMPY_CHECK([basic header manipulation],[
h = rpm.hdr()
h['name'] = 'testpkg'
h['version'] = '1.0'
@@ -41,7 +24,7 @@ myprint(h['nevra'])
testpkg-1.0-1.noarch]
)
-PY_CHECK([reading a package file],[
+RPMPY_CHECK([reading a package file],[
ts = rpm.ts()
h = ts.hdrFromFdno('${RPMDATA}/RPMS/hello-1.0-1.ppc64.rpm')
myprint(h['arch'])
@@ -49,7 +32,7 @@ myprint(h['arch'])
[ppc64]
)
-PY_CHECK([add package to transaction],[
+RPMPY_CHECK([add package to transaction],[
ts = rpm.ts()
ts.addInstall('${RPMDATA}/RPMS/foo-1.0-1.noarch.rpm', 'u')
for e in ts: