Пример #1
0
 def test_name_after_init(self):
     attribute = Attribute('Name', 'Prefix')
     self.assertEqual('Name', attribute.name)
Пример #2
0
 def test_hash_when_name_and_attribute_are_equal(self):
     attribute_a = Attribute('Name', 'Prefix')
     attribute_b = Attribute('Name', 'Prefix')
     self.assertEqual(hash(attribute_a), hash(attribute_b))
Пример #3
0
 def test_equality_when_name_and_attribute_are_equal(self):
     attribute_a = Attribute('Name', 'Prefix')
     attribute_b = Attribute('Name', 'Prefix')
     self.assertEqual(attribute_a, attribute_b)
Пример #4
0
 def test_equality_when_attribute_is_different(self):
     attribute_a = Attribute('Name', 'Prefix')
     attribute_b = Attribute('Name', 'Other')
     self.assertNotEqual(attribute_a, attribute_b)
Пример #5
0
 def test_prefixed_after_init(self):
     attribute = Attribute('Name', 'Prefix')
     self.assertEqual('Prefix.Name', attribute.prefixed)