aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests/samplebinding/namespace_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/tests/samplebinding/namespace_test.py')
-rw-r--r--sources/shiboken2/tests/samplebinding/namespace_test.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/shiboken2/tests/samplebinding/namespace_test.py b/sources/shiboken2/tests/samplebinding/namespace_test.py
index a5065c7a..5fcdab97 100644
--- a/sources/shiboken2/tests/samplebinding/namespace_test.py
+++ b/sources/shiboken2/tests/samplebinding/namespace_test.py
@@ -33,12 +33,7 @@
import unittest
from sample import *
-from py3kcompat import IS_PY3K
-if IS_PY3K:
- TYPE_STR = "class"
-else:
- TYPE_STR = "type"
class TestEnumUnderNamespace(unittest.TestCase):
def testInvisibleNamespace(self):
@@ -59,11 +54,16 @@ class TestClassesUnderNamespace(unittest.TestCase):
self.assertEqual(res, 4)
def testTpNames(self):
- self.assertEqual(str(SampleNamespace.SomeClass), "<%s 'sample.SampleNamespace.SomeClass'>"%TYPE_STR)
- self.assertEqual(str(SampleNamespace.SomeClass.ProtectedEnum), "<%s 'sample.SampleNamespace.SomeClass.ProtectedEnum'>"%TYPE_STR)
- self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum'>"%TYPE_STR)
- self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough'>"%TYPE_STR)
- self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum), "<%s 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum'>"%TYPE_STR)
+ self.assertEqual(str(SampleNamespace.SomeClass),
+ "<class 'sample.SampleNamespace.SomeClass'>")
+ self.assertEqual(str(SampleNamespace.SomeClass.ProtectedEnum),
+ "<class 'sample.SampleNamespace.SomeClass.ProtectedEnum'>")
+ self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum),
+ "<class 'sample.SampleNamespace.SomeClass.SomeInnerClass.ProtectedEnum'>")
+ self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough),
+ "<class 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough'>")
+ self.assertEqual(str(SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum),
+ "<class 'sample.SampleNamespace.SomeClass.SomeInnerClass.OkThisIsRecursiveEnough.NiceEnum'>")
if __name__ == '__main__':
unittest.main()