diff options
author | Adam Stokes <adam.stokes@ubuntu.com> | 2013-10-30 22:14:55 -0400 |
---|---|---|
committer | Adam Stokes <adam.stokes@ubuntu.com> | 2013-10-30 22:14:55 -0400 |
commit | cd99ebea74a606fe037580eead2702f4c2dd7c65 (patch) | |
tree | 3ab32f8ed6a19d2dfbfa87d8c55f86bdd0e509a7 /tests/archive_tests.py | |
parent | c398e45ce3e22062df08c2d4f9dc1eed1ee99e1d (diff) | |
download | sos-cd99ebea74a606fe037580eead2702f4c2dd7c65.tar.gz |
Python 3 port
This includes a necessary dependency on python-six for its compability layer
since we are wanting to continue support for both Python 2.7.x and Python 3.x.
In addition, this will allow us to effectively phase out Python 2 support
when/if the time arises that all interested distributions have done away with
Python 2.
This port passes all unittests for both python 2.7.x and python 3.3.x
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Diffstat (limited to 'tests/archive_tests.py')
-rw-r--r-- | tests/archive_tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/archive_tests.py b/tests/archive_tests.py index abdce994..9cd7bd1b 100644 --- a/tests/archive_tests.py +++ b/tests/archive_tests.py @@ -9,6 +9,8 @@ import shutil from sos.archive import TarFileArchive, ZipFileArchive +# PYCOMPAT +import six class ZipFileArchiveTest(unittest.TestCase): @@ -66,14 +68,14 @@ class ZipFileArchiveTest(unittest.TestCase): self.zf.add_string('this is my content', 'tests/string_test.txt') afp = self.zf.open_file('tests/string_test.txt') - self.assertEquals('this is my content', afp.read()) + self.assertEquals(six.b('this is my content'), afp.read()) def test_overwrite_file(self): self.zf.add_string('this is my content', 'tests/string_test.txt') self.zf.add_string('this is my new content', 'tests/string_test.txt') afp = self.zf.open_file('tests/string_test.txt') - self.assertEquals('this is my new content', afp.read()) + self.assertEquals(six.b('this is my new content'), afp.read()) # Disabled as new api doesnt provide a add_link routine # def test_make_link(self): |