diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-09-15 14:50:51 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-09-15 14:50:51 +0200 |
commit | cf12fa7a22baa5bca2c2ea67b27d1580fa95b036 (patch) | |
tree | 3ae8d8d39a29b0c63b1882ee23f9d6ea1d7a517b /test | |
parent | 9e777836d0b6f51c0728ebe73e8b8d993ba16911 (diff) | |
download | logilab-common-cf12fa7a22baa5bca2c2ea67b27d1580fa95b036.tar.gz |
[py3k] fix unittest_modutils for standard modules
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_modutils.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/unittest_modutils.py b/test/unittest_modutils.py index 0c14017..ade825b 100644 --- a/test/unittest_modutils.py +++ b/test/unittest_modutils.py @@ -164,7 +164,12 @@ class is_standard_module_tc(TestCase): """ def test_knownValues_is_standard_module_0(self): - self.assertEqual(modutils.is_standard_module('__builtin__'), True) + if sys.version_info < (3, 0): + self.assertEqual(modutils.is_standard_module('__builtin__'), True) + self.assertEqual(modutils.is_standard_module('builtins'), False) + else: + self.assertEqual(modutils.is_standard_module('__builtin__'), False) + self.assertEqual(modutils.is_standard_module('builtins'), True) def test_knownValues_is_standard_module_1(self): self.assertEqual(modutils.is_standard_module('sys'), True) @@ -176,7 +181,14 @@ class is_standard_module_tc(TestCase): self.assertEqual(modutils.is_standard_module('unknown'), False) def test_knownValues_is_standard_module_4(self): - self.assertEqual(modutils.is_standard_module('StringIO'), True) + if sys.version_info < (3, 0): + self.assertEqual(modutils.is_standard_module('StringIO'), True) + else: + self.assertEqual(modutils.is_standard_module('StringIO'), False) + if sys.version_info < (2, 6): + self.assertEqual(modutils.is_standard_module('io'), False) + else: + self.assertEqual(modutils.is_standard_module('io'), True) def test_knownValues_is_standard_module_5(self): self.assertEqual(modutils.is_standard_module('data.module', (DATADIR,)), True) |