Esempio n. 1
0
 def test_database_shared_headings_return_type(self):
     dictionary = {
         'jgoodall': {
             'surname': 'Goodall',
             'name': 'Jane',
             'born': 1934,
             'died': None,
             'notes': 'Primate research',
             'author': ['In the Shadow of Man', 'The Chimps of Gombe']
         },
         'rfranklin': {
             'surname': 'Franklin',
             'name': 'Rosalind',
             'born': 1920,
             'died': 1957,
             'notes': 'DNA research'
         },
         'aturing': {
             'surname': 'Turing',
             'name': 'Alan',
             'born': 1912,
             'died': 1954,
             'notes': 'polymath',
             'author': ['Systems of Logic based on Ordinals']
         }
     }
     self.assertEqual(set, type(q10.database_shared_headings(dictionary)))
Esempio n. 2
0
 def test_database_shared_headings_invalid(self):
     with self.assertRaises(TypeError):
         q10.database_shared_headings({})
Esempio n. 3
0
 def test_database_shared_headings_correct_values_in_set(self):
     self.assertEqual(database_shared_headings(superheroes),
                      {'name', 'superpower', 'born'})
Esempio n. 4
0
 def test_database_shared_headings_no_shared_headings(self):
     self.assertEqual(database_shared_headings(items), set())
Esempio n. 5
0
 def test_database_shared_headings_return_type(self):
     self.assertIsInstance(database_shared_headings(superheroes), set)