Esempio n. 1
0
 def test_unequal_if_not_same_annotation(self):
     binding_key_one = binding_keys.BindingKey(
         'arg-name-one', annotations.Annotation('an-annotation'))
     binding_key_two = binding_keys.BindingKey(
         'arg-name-two', annotations.Annotation('another-annotation'))
     self.assertNotEqual(binding_key_one, binding_key_two)
     self.assertNotEqual(hash(binding_key_one), hash(binding_key_two))
     self.assertNotEqual(str(binding_key_one), str(binding_key_two))
Esempio n. 2
0
 def test_equal_if_same_arg_name_and_annotation(self):
     binding_key_one = binding_keys.BindingKey(
         'an-arg-name', annotations.Annotation('an-annotation'))
     binding_key_two = binding_keys.BindingKey(
         'an-arg-name', annotations.Annotation('an-annotation'))
     self.assertEqual(binding_key_one, binding_key_two)
     self.assertEqual(hash(binding_key_one), hash(binding_key_two))
     self.assertEqual(str(binding_key_one), str(binding_key_two))
Esempio n. 3
0
 def test_annotation_as_adjective(self):
     binding_key = binding_keys.BindingKey(
         'an-arg-name', annotations.Annotation('an-annotation'))
     self.assertEqual('annotated with "an-annotation"',
                      binding_key.annotation_as_adjective())
Esempio n. 4
0
 def test_str(self):
     binding_key = binding_keys.BindingKey(
         'an-arg-name', annotations.Annotation('an-annotation'))
     self.assertEqual(
         'the binding name "an-arg-name" (annotated with "an-annotation")',
         str(binding_key))