summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPanu Matilainen <Panu Matilainen pmatilai@redhat.com>2011-07-07 16:27:03 +0300
committerPanu Matilainen <Panu Matilainen pmatilai@redhat.com>2011-07-07 16:31:46 +0300
commiteb94de639491d33aea0ad50bf8f58d99f220c544 (patch)
treee9bfc2aee36e858b379ce48b5ed5bb7705176db6 /tests
parent63d4926bf601797cbcdf4d5d99e8db4d2530d5ef (diff)
downloadrpm-eb94de639491d33aea0ad50bf8f58d99f220c544.tar.gz
rpm-eb94de639491d33aea0ad50bf8f58d99f220c544.tar.bz2
rpm-eb94de639491d33aea0ad50bf8f58d99f220c544.zip
Teach python rpmio bindings about Fdescr()
- Similarly to python file object having o.name, export Fdescr() as fd.name. Python uses <foo> for non-paths but [foo] seems like a safer choice wrt accidental redirections. - Also add a basic testcase for fd.name
Diffstat (limited to 'tests')
-rw-r--r--tests/rpmpython.at4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/rpmpython.at b/tests/rpmpython.at
index fe2facab9..6275502e6 100644
--- a/tests/rpmpython.at
+++ b/tests/rpmpython.at
@@ -41,6 +41,8 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]:
fd = rpm.fd(fn, 'w', iot)
if fd.write(data) != len(data):
myprint('%s write fail' % iot)
+ if fn != fd.name:
+ myprint('bad file name %s' % fd.name)
fd = rpm.fd(fn, 'r', iot)
rdata = fd.read()
if rdata != data:
@@ -50,6 +52,8 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]:
fd.seek(0)
else:
fd = rpm.fd(fn, 'r', iot)
+ if fn != fd.name:
+ myprint('bad file name %s' % fd.name)
rdata = fd.read(len(msg))
if rdata != msg:
myprint('%s sized read fail (got %d bytes)\n%s' % (iot, len(rdata), rdata))