def testScopedEnumType(self): pyType = sample.getPythonType('Abstract::Type') self.assertEqual(pyType, sample.Abstract.Type)
def testMapContainerType(self): pyType = sample.getPythonType('std::map<std::string,int>') self.assertEqual(pyType, dict)
def testGlobalEnumType(self): pyType = sample.getPythonType('GlobalEnum') self.assertEqual(pyType, sample.GlobalEnum)
def testPairContainerType(self): pyType = sample.getPythonType('std::pair<Complex,int>') self.assertEqual(pyType, list)
def testListContainerType(self): pyType = sample.getPythonType('std::list<int>') self.assertEqual(pyType, list)
def testPrimitiveTypeAndTypedef(self): pyType = sample.getPythonType('double') self.assertEqual(pyType, float) pyTypedef = sample.getPythonType('real') self.assertEqual(pyType, pyTypedef)
def testGetUsersPrimitiveTypeWithoutTargetLangApiName(self): '''If the primitive type attribute "target-lang-api-name" is not set there'll be no Python type associated with the C++ type.''' pyType = sample.getPythonType('PStr') self.assertEqual(pyType, None)
def testGetUsersPrimitiveType(self): pyType = sample.getPythonType('OddBool') self.assertEqual(pyType, bool)
def testGetValueType(self): pyType1 = sample.getPythonType('Point') self.assertEqual(pyType1, sample.Point) pyType2 = sample.getPythonType('Point*') self.assertEqual(pyType2, sample.Point) self.assertEqual(pyType1, pyType2)
def testGetObjectType(self): pyType1 = sample.getPythonType('ObjectType') self.assertEqual(pyType1, sample.ObjectType) pyType2 = sample.getPythonType('ObjectType*') self.assertEqual(pyType2, sample.ObjectType) self.assertEqual(pyType1, pyType2)