summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2018-10-04 17:41:19 +0300
committerPanu Matilainen <pmatilai@redhat.com>2018-10-04 17:50:43 +0300
commit86f7898dd6a7fa8718c02675f5a7ee04ff987422 (patch)
tree6354ebf4c48d10facec8a34f6ff1add70463b05c
parent511eef19298765e3639bccbe98bc3a50023f45b2 (diff)
downloadrpm-86f7898dd6a7fa8718c02675f5a7ee04ff987422.tar.gz
Fix couple of bytes vs strings issues in Python tests
For the purposes of rpmio testing and importing public key, we're dealing with bytes rather than encoded strings. In the carefree days of Python 2 such details didn't matter, in Python 3 they cause failures. The signed package test still fails after this one but it's due to a more general issue.
-rw-r--r--tests/rpmpython.at4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/rpmpython.at b/tests/rpmpython.at
index 9b8e3784c..de05724ab 100644
--- a/tests/rpmpython.at
+++ b/tests/rpmpython.at
@@ -33,7 +33,7 @@ prexp(mname)
[])
RPMPY_TEST([basic rpmio],[
-msg = 'Killroy was here\n'
+msg = b'Killroy was here\n'
data = msg * 10
# TODO: test other compression types too if built in
for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]:
@@ -173,7 +173,7 @@ except rpm.error as e:
RPMPY_TEST([reading a signed package file 2],[
-keydata = open('${RPMDATA}/keys/rpm.org-rsa-2048-test.pub').read()
+keydata = open('${RPMDATA}/keys/rpm.org-rsa-2048-test.pub', 'rb').read()
pubkey = rpm.pubkey(keydata)
keyring = rpm.keyring()
keyring.addKey(pubkey)