示例#1
0
 def test_attribute_label(self):
     """
     the attribtue "label" can be set
     """
     e = Unit(0.01, u'cm', u'centimetre')
     self.assertEqual(e.label, u'centimetre')
     e.label = u'metre'
     self.assertEqual(e.label, u'metre')
示例#2
0
 def test_attribute_factor(self):
     """
     the attribtue "factor" can be set
     """
     e = Unit(0.01, 'cm', 'centimetre')
     self.assertEqual(e.factor, 0.01)
     e.factor = 0.32
     self.assertEqual(e.factor, 0.32)
示例#3
0
 def test_attribute_abbrev(self):
     """
     the attribtue "abbrev" can be set
     """
     e = Unit(0.01, u'cm', u'centimetre')
     self.assertEqual(e.abbrev, u'cm')
     e.abbrev = u'cm²'
     self.assertEqual(e.abbrev, u'cm²')