Beispiel #1
0
 def test_dict_does_not_contain_key_failure_with_message(self):
     dict3 = {
             'd': 'dvalue',
             'e': 'evalue',
             'f': 'fvalue',
         }
     try:
         Assert.does_not_contain('d', dict3, msg="failure message")
     except AssertionError as e:
         Assert.equal(e.msg, "%s should not be found in %s. failure message" % ('d', dict3))
Beispiel #2
0
 def test_list_of_dicts_does_not_contain_dict(self):
     dict1 = {
             'a': 'avalue',
             'b': 'bvalue',
             'c': 'cvalue',
         }
     dict2 = {
             'a': 'dvalue',
             'b': 'evalue',
             'c': 'fvalue',
         }
     dict3 = {
             'd': 'dvalue',
             'e': 'evalue',
             'f': 'fvalue',
         }
     list_of_dicts = [ dict1, dict2 ]
     Assert.does_not_contain(dict3, list_of_dicts)
Beispiel #3
0
 def test_list_of_dicts_does_not_contain_dict_failure_no_message(self):
     dict1 = {
             'a': 'avalue',
             'b': 'bvalue',
             'c': 'cvalue',
         }
     dict2 = {
             'a': 'dvalue',
             'b': 'evalue',
             'c': 'fvalue',
         }
     dict3 = {
             'd': 'dvalue',
             'e': 'evalue',
             'f': 'fvalue',
         }
     list_of_dicts = [ dict1, dict2, dict3 ]
     try:
         Assert.does_not_contain(dict3, list_of_dicts)
     except AssertionError as e:
         Assert.equal(e.msg, "%s should not be found in %s. " % (dict3, list_of_dicts))
Beispiel #4
0
 def test_dict_does_not_contain_key(self):
     Assert.does_not_contain('a', { 'b': 'bvalue', 'c': 'cvalue', 'd': 'dvalue' })
Beispiel #5
0
 def test_list_of_strings_does_not_contain_string(self):
     Assert.does_not_contain('turtle', ['dog', 'cat', 'guiny pig'])
Beispiel #6
0
 def test_string_does_not_contain_letter(self):
     Assert.does_not_contain('a', 'bcd')