Example #1
0
 def test_empty_dictionary_is_injective(self):
     assert G.is_injective({})
Example #2
0
 def test_two_keys_mapping_to_the_same_value(self):
     assert not G.is_injective({'a': 'c', 'b': 'c'})
Example #3
0
 def test_dictionary_with_same_keys_and_values(self):
     assert G.is_injective({'a': 'b', 'b': 'a'})
Example #4
0
 def test_identity(self):
     assert G.is_injective({'a': 'a'})
Example #5
0
 def test_dictionary_with_different_keys_and_values(self):
     assert G.is_injective({'a': 'x', 'b': 'y'})