Fix minors issues with strings and remove print statements

This commit is contained in:
Vladimir Diaz 2015-04-06 21:29:21 -04:00
parent 110c8a196b
commit 98df2014b6
3 changed files with 3 additions and 6 deletions

View file

@ -84,7 +84,6 @@ def test_create_rsa_signature(self):
pycrypto.create_rsa_signature, '', data)
# Check for invalid 'data'.
print(repr(private_rsa))
pycrypto.create_rsa_signature(private_rsa, '')
self.assertRaises(tuf.CryptoError,

View file

@ -443,8 +443,6 @@ def test_2__import_delegations(self):
self.repository_updater.metadata['current']['targets']\
['delegations']['keys'][existing_keyid]['keyid'] = '123'
print(repr(self.repository_updater.metadata['current']['targets']\
['delegations']['keys'][existing_keyid]['keyid']))
self.repository_updater._import_delegations('targets')
#self.assertRaises(tuf.Error, self.repository_updater._import_delegations,
# 'targets')
@ -1227,7 +1225,7 @@ def test_9__get_target_hash(self):
def test_10__hard_check_file_length(self):
# Test for exception if file object is not equal to trusted file length.
temp_file_object = tuf.util.TempFile()
temp_file_object.write('X')
temp_file_object.write(b'X')
temp_file_object.seek(0)
self.assertRaises(tuf.DownloadLengthMismatchError,
self.repository_updater._hard_check_file_length,
@ -1240,7 +1238,7 @@ def test_10__hard_check_file_length(self):
def test_10__soft_check_file_length(self):
# Test for exception if file object is not equal to trusted file length.
temp_file_object = tuf.util.TempFile()
temp_file_object.write('XXX')
temp_file_object.write(b'XXX')
temp_file_object.seek(0)
self.assertRaises(tuf.DownloadLengthMismatchError,
self.repository_updater._soft_check_file_length,

View file

@ -241,7 +241,7 @@ def test_A6_tempfile_decompress_temp_file_object(self):
# Test decompression of invalid gzip file.
temp_file = tuf.util.TempFile()
temp_file.write('bad zip')
temp_file.write(b'bad zip')
contents = temp_file.read()
self.assertRaises(tuf.DecompressionError,
temp_file.decompress_temp_file_object, 'gzip')