예제 #1
0
 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'))
예제 #2
0
 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'))
예제 #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)
예제 #4
0
 def test_in_dict_true(self):
     self.assertEqual(
         dict_membership.in_dict({
             'A': 90,
             'B': 80,
             'C': 70,
             'D': 60
         }, 'A'), True)
예제 #5
0
 def test_in_dict_true(self):
     self.assertTrue(
         dm.in_dict('A', {
             'A': 'apple',
             'B': 'banana',
             'C': 'cantaloupe',
             'D': 'dragonfruit'
         }))
예제 #6
0
 def test_in_dict_false(self):
     self.assertEqual(
         dict_membership.in_dict({
             'A': 90,
             'B': 80,
             'C': 70,
             'D': 60
         }, 'F'), False)
예제 #7
0
 def test_in_dict_flase(self):
     self.assertFalse(
         dm.in_dict('F', {
             'A': 'apple',
             'B': 'banana',
             'C': 'cantaloupe',
             'D': 'dragonfruit'
         }))
예제 #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))
예제 #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'))
예제 #10
0
 def test_in_dict_true(self, input):
     self.assertTrue(dict_membership.in_dict(), 'a')
예제 #11
0
 def test_in_dict_false(self, input):
     self.assertFalse(dict_membership.in_dict(), 'd')
예제 #12
0
 def test_in_set_true(self):
     self.assertEqual(dict_membership.in_dict(mySet, 8), False)
예제 #13
0
 def test_something(self):
     self.assertEqual(dict_membership.in_dict(mySet, 4), True)
예제 #14
0
 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)
예제 #15
0
 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)
예제 #16
0
 def test_in_dict_false(self):
     self.assertEqual(in_dict({'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}, 'Z'), False)
예제 #17
0
 def test_in_dict_true(self):
     self.assertTrue(in_dict(self.dic, 'b'))
예제 #18
0
 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'))
예제 #19
0
 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))
예제 #20
0
 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))
예제 #23
0
 def test_in_dict_true(self):
     self.assertFalse(in_dict(12))
예제 #24
0
 def test_in_dict_false(self):
     self.assertFalse(in_dict(self.dic, 'c'))
예제 #25
0
 def test_in_dict_true(self):
     self.assertTrue(in_dict(3))
예제 #26
0
 def test_in_dict_true(self):
     self.assertEqual(in_dict({'A': 90, 'B': 80, 'C': 70, 'D': 60, 'F': 0}, 'A'), True)
예제 #27
0
 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'))
예제 #28
0
 def test_in_dict_true(self):
     self.assertEqual('True', dict_membership.in_dict("type"))
예제 #29
0
 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))
예제 #30
0
 def test_in_dict_false(self):
     self.assertEqual('False', dict_membership.in_dict("name"))