def test_equal_if_same_field_values(self):
     arg_binding_key_one = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     arg_binding_key_two = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     self.assertEqual(arg_binding_key_one, arg_binding_key_two)
     self.assertEqual(hash(arg_binding_key_one), hash(arg_binding_key_two))
     self.assertEqual(str(arg_binding_key_one), str(arg_binding_key_two))
 def test_unequal_if_not_same_indirection(self):
     arg_binding_key_one = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     arg_binding_key_two = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.NO_INDIRECTION)
     self.assertNotEqual(arg_binding_key_one, arg_binding_key_two)
     self.assertNotEqual(hash(arg_binding_key_one),
                         hash(arg_binding_key_two))
     # Strings will be equal, since indirection isn't part of the string.
     self.assertEqual(str(arg_binding_key_one), str(arg_binding_key_two))
 def test_unequal_if_not_same_arg_name(self):
     arg_binding_key_one = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     arg_binding_key_two = arg_binding_keys.ArgBindingKey(
         'other-arg-name',
         binding_keys.new('other-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     self.assertNotEqual(arg_binding_key_one, arg_binding_key_two)
     self.assertNotEqual(hash(arg_binding_key_one),
                         hash(arg_binding_key_two))
     self.assertNotEqual(str(arg_binding_key_one), str(arg_binding_key_two))
 def test_str(self):
     arg_binding_key = arg_binding_keys.ArgBindingKey(
         'an-arg-name', binding_keys.new('an-arg-name', 'an-annotation'),
         provider_indirections.INDIRECTION)
     self.assertEqual(
         'the arg named "an-arg-name" annotated with "an-annotation"',
         str(arg_binding_key))