def test_in_dict_true(self):
     """
     test a true return from in_dict()
     :return:
     """
     my_dict = {'A': 3, 'B': 44, 'C': 8}
     self.assertTrue(in_dict(my_dict, 'A'))
 def test_in_dict_false(self):
     """
     test a false return from in_dict()
     :return:
     """
     my_dict = {'A': 3, 'B': 44, 'C': 8}
     self.assertFalse(in_dict(my_dict, 'D'))
Exemple #3
0
 def test_in_dict_true(self):
     #create a set as a variable
     a_dict = {'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}
     #create an element as a variable
     key = 'C'
     #assertTrue, expect  True to be the result
     #assertTrue(function_name(parameter11, parameter2)
     self.assertTrue(dm.in_dict(a_dict, key), key)
 def test_in_dict_true(self):
     self.assertEqual(
         dict_membership.in_dict({
             'A': 90,
             'B': 80,
             'C': 70,
             'D': 60
         }, 'A'), True)
Exemple #5
0
 def test_in_dict_true(self):
     self.assertTrue(
         dm.in_dict('A', {
             'A': 'apple',
             'B': 'banana',
             'C': 'cantaloupe',
             'D': 'dragonfruit'
         }))
 def test_in_dict_false(self):
     self.assertEqual(
         dict_membership.in_dict({
             'A': 90,
             'B': 80,
             'C': 70,
             'D': 60
         }, 'F'), False)
Exemple #7
0
 def test_in_dict_flase(self):
     self.assertFalse(
         dm.in_dict('F', {
             'A': 'apple',
             'B': 'banana',
             'C': 'cantaloupe',
             'D': 'dragonfruit'
         }))
Exemple #8
0
 def test_in_dict_false(self):
     self.assertFalse(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, 'Jason'))
     self.assertFalse(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, 101))
     self.assertFalse(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, -1))
Exemple #9
0
 def test_in_dict_true(self):
     self.assertTrue(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, 'Ted'))
     self.assertTrue(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, 'Ty'))
     self.assertTrue(
         membership.in_dict({
             101: 'Ty',
             102: 'Jim',
             103: 'Sue',
             104: 'Ted'
         }, 'Ted'))
 def test_in_dict_true(self, input):
     self.assertTrue(dict_membership.in_dict(), 'a')
 def test_in_dict_false(self, input):
     self.assertFalse(dict_membership.in_dict(), 'd')
 def test_in_set_true(self):
     self.assertEqual(dict_membership.in_dict(mySet, 8), False)
 def test_something(self):
     self.assertEqual(dict_membership.in_dict(mySet, 4), True)
 def test_in_dict_true(self):
     dict = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5}
     self.assertEqual(True, dict_membership.in_dict(dict, 'B'), True)
 def test_in_dict_false(self):
     dict = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5}
     self.assertEqual(False, dict_membership.in_dict(dict, 'X'), False)
 def test_in_dict_false(self):
     self.assertEqual(in_dict({'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}, 'Z'), False)
 def test_in_dict_true(self):
     self.assertTrue(in_dict(self.dic, 'b'))
 def test_in_dict_true(self):
     d = {'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}
     self.assertEqual(True, dict_membership.in_dict(d, 'A'))
 def test_in_dict_false(self):
     test_dict = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7}
     key_element = 'C#'
     self.assertFalse(dict_membership.in_dict(test_dict, key_element))
 def test_in_dict_false(self):
     """tests in_set for something we know is not in the set"""
     second_dict = {'Apples': 90, 'Bananas': 100, 'Cherries': 300}
     second_search = 'Dogs'
     self.assertFalse(in_dict(second_dict, second_search))
 def test_in_dict_true(self):
     test_dict = {'A':1,'G':7,'K':11}
     test_true = in_dict(test_dict)
     self.assertEqual(test_true, ('Does the dictionary contain A? ',True))
 def test_in_dict_false(self):
     test_dict = {'B':2,'G':7,'K':11}
     test_false = in_dict(test_dict)
     self.assertEqual(test_false, ('Does the dictionary contain A? ',False))
Exemple #23
0
 def test_in_dict_true(self):
     self.assertFalse(in_dict(12))
 def test_in_dict_false(self):
     self.assertFalse(in_dict(self.dic, 'c'))
Exemple #25
0
 def test_in_dict_true(self):
     self.assertTrue(in_dict(3))
 def test_in_dict_true(self):
     self.assertEqual(in_dict({'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}, 'A'), True)
 def test_in_dict_false(self):
     d = {'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}
     self.assertEqual(False, dict_membership.in_dict(d, 'G'))
Exemple #28
0
 def test_in_dict_true(self):
     self.assertEqual('True', dict_membership.in_dict("type"))
 def test_in_dict_true(self):
     dict_to_pass = {'Name': 'Johnny', 'Age': 3, 'School': 'Elm Elementary'}
     element = 'Age'
     self.assertTrue(dict_membership.in_dict(dict_to_pass, element))
Exemple #30
0
 def test_in_dict_false(self):
     self.assertEqual('False', dict_membership.in_dict("name"))