Example #1
0
 def testConstructionParameters(self):
     attr = Attribute('name', 'code', 'integer', 'vendor')
     self.assertEqual(attr.name, 'name')
     self.assertEqual(attr.code, 'code')
     self.assertEqual(attr.type, 'integer')
     self.assertEqual(attr.vendor, 'vendor')
     self.assertEqual(len(attr.values), 0)
Example #2
0
 def testNamedConstructionParameters(self):
     attr = Attribute(name='name',
                      code='code',
                      datatype='integer',
                      vendor='vendor')
     self.assertEqual(attr.name, 'name')
     self.assertEqual(attr.code, 'code')
     self.assertEqual(attr.type, 'integer')
     self.assertEqual(attr.vendor, 'vendor')
     self.assertEqual(len(attr.values), 0)
Example #3
0
 def testValues(self):
     attr = Attribute('name', 'code', 'integer', False, 'vendor',
                      dict(pie='custard', shake='vanilla'))
     self.assertEqual(len(attr.values), 2)
     self.assertEqual(attr.values['shake'], 'vanilla')