fixed py3 warnings: now using bytes() instead of str()

This commit is contained in:
cis-kuldeep 2021-07-30 18:41:26 +05:30
parent 383e354263
commit 14bbbff742
No known key found for this signature in database
GPG Key ID: 67B47D8A06FA45E4

View File

@ -197,7 +197,7 @@ class TestBlindSig(unittest.TestCase):
output.extend(pubkey) output.extend(pubkey)
output.extend(signature) output.extend(signature)
signer_obj = child_obj signer_obj = child_obj
verifychain = ECCBlindChain(ca=ca.pubkey(), chain=str(output)) verifychain = ECCBlindChain(ca=ca.pubkey(), chain=bytes(output))
self.assertFalse(verifychain.verify(msg, 1)) self.assertFalse(verifychain.verify(msg, 1))
def test_blind_sig_chain_wrong_msg(self): # pylint: disable=too-many-locals def test_blind_sig_chain_wrong_msg(self): # pylint: disable=too-many-locals
@ -232,7 +232,7 @@ class TestBlindSig(unittest.TestCase):
output.extend(pubkey) output.extend(pubkey)
output.extend(signature) output.extend(signature)
signer_obj = child_obj signer_obj = child_obj
verifychain = ECCBlindChain(ca=ca.pubkey(), chain=str(output)) verifychain = ECCBlindChain(ca=ca.pubkey(), chain=bytes(output))
self.assertFalse(verifychain.verify(fake_msg, 1)) self.assertFalse(verifychain.verify(fake_msg, 1))
def test_blind_sig_chain_wrong_intermediary(self): # pylint: disable=too-many-locals def test_blind_sig_chain_wrong_intermediary(self): # pylint: disable=too-many-locals
@ -270,5 +270,5 @@ class TestBlindSig(unittest.TestCase):
output.extend(pubkey) output.extend(pubkey)
output.extend(signature) output.extend(signature)
signer_obj = child_obj signer_obj = child_obj
verifychain = ECCBlindChain(ca=ca.pubkey(), chain=str(output)) verifychain = ECCBlindChain(ca=ca.pubkey(), chain=bytes(output))
self.assertFalse(verifychain.verify(msg, 1)) self.assertFalse(verifychain.verify(msg, 1))