예제 #1
0
 def test_composite_key_with_additional_values(self):
     test_data = {
         'name': 'test',
         'level': 7,
         'other': 'stuff',
         'more': 'things'
     }
     assert matching.composite_key(test_data) == 'test: 7'
예제 #2
0
 def test_composite_key_with_lower_case(self):
     test_data = {'name': 'foo', 'level': 'bar'}
     assert matching.composite_key(test_data) == 'foo: bar'
예제 #3
0
 def test_composite_key_fails_when_value_missing(self):
     test_data = {'level': 7, 'other': 'stuff', 'more': 'things'}
     with pytest.raises(KeyError):
         matching.composite_key(test_data)
예제 #4
0
 def test_composite_key_with_integers(self):
     test_data = {'name': 1, 'level': 5}
     assert matching.composite_key(test_data) == '1: 5'
예제 #5
0
 def test_composite_key_with_upper_case(self):
     test_data = {'name': 'FOO', 'level': 'BAR'}
     assert matching.composite_key(test_data) == 'foo: bar'