Exemplo n.º 1
0
 def testScopedEnumType(self):
     pyType = sample.getPythonType('Abstract::Type')
     self.assertEqual(pyType, sample.Abstract.Type)
Exemplo n.º 2
0
 def testMapContainerType(self):
     pyType = sample.getPythonType('std::map<std::string,int>')
     self.assertEqual(pyType, dict)
Exemplo n.º 3
0
 def testGlobalEnumType(self):
     pyType = sample.getPythonType('GlobalEnum')
     self.assertEqual(pyType, sample.GlobalEnum)
Exemplo n.º 4
0
 def testPairContainerType(self):
     pyType = sample.getPythonType('std::pair<Complex,int>')
     self.assertEqual(pyType, list)
Exemplo n.º 5
0
 def testListContainerType(self):
     pyType = sample.getPythonType('std::list<int>')
     self.assertEqual(pyType, list)
Exemplo n.º 6
0
 def testPrimitiveTypeAndTypedef(self):
     pyType = sample.getPythonType('double')
     self.assertEqual(pyType, float)
     pyTypedef = sample.getPythonType('real')
     self.assertEqual(pyType, pyTypedef)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 def testGetUsersPrimitiveType(self):
     pyType = sample.getPythonType('OddBool')
     self.assertEqual(pyType, bool)
Exemplo n.º 9
0
 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)
Exemplo n.º 10
0
 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)