Ejemplo n.º 1
0
 def test_with_matched_object_being_a_pair_sequence_generator(self):
     assert_that(((k, v) for k, v in dict(key=1).items()), has_keys(['key']))
Ejemplo n.º 2
0
 def test_with_matched_object_being_a_dictionary_generator(self):
     assert_that({k: v for k, v in dict(key=1).items()}, has_keys(['key']))
Ejemplo n.º 3
0
 def test_with_keys_defined_in_a_generator(self):
     assert_that(dict(key=1), has_keys(k for k in ['key']))
Ejemplo n.º 4
0
 def test_with_matched_object_being_a_pair_sequence(self):
     assert_that((('key', 1),), has_keys(['key']))
Ejemplo n.º 5
0
 def test_one_of_many_keys(self):
     assert_that(dict(key=1, key2=2), has_keys(['key']))
Ejemplo n.º 6
0
 def test_none_of_many_different_keys(self):
     assert_that(dict(key=1, key2=2), is_not(has_keys([u'ná'])))
Ejemplo n.º 7
0
 def test_different_key(self):
     assert_that(dict(key=1), is_not(has_keys(['nokey'])))
Ejemplo n.º 8
0
 def test_same_keys(self):
     assert_that(dict(key=1, key2=2), has_keys(['key', 'key2']))
Ejemplo n.º 9
0
 def test_same_key(self):
     assert_that(dict(key=1), has_keys(['key']))
Ejemplo n.º 10
0
 def test_args_constructor(self):
     assert_that(dict(key=1, key2=2), has_keys('key', 'key2'))
Ejemplo n.º 11
0
 def test_empty_dict(self):
     assert_that({}, has_keys([]))