def testDictionaryDoesNotLoadFromEmptyJson(self): indices = getBoijeLetterIndices() dictionary_should_be = consolidateIndicesToDictionary(indices) boije_directory, json_file_path = boijeCollectionInit(DESTINATION_DIRECTORY, BOIJE_DIRECTORY_NAME) returned_dictionary = dictionaryInit(json_file_path) self.assertEqual(returned_dictionary, dictionary_should_be)
def testGetAllLetterIndexes(self): c_index = 'Boije_c.htm' ae_index = 'Boije_ae.htm' list_of_letter_indexes = getBoijeLetterIndices() self.assertIn(c_index, list_of_letter_indexes) self.assertIn(ae_index, list_of_letter_indexes)
def testConvertEveryIndexToASuperBigDictionary(self): indices = getBoijeLetterIndices() composer_1, score_1 = 'Carcassi_M', 'Op_3_Douze_petites_pieces_Pour_Guitare_ou_Lyre' composer_2, score_2 = 'Knjze_FM', 'Op_16_Ober_Oesterreicher' composer_3, score_3 = 'Zurfluh_A', 'Romance_sans_paroles' dictionary_of_every_composer = consolidateIndicesToDictionary(indices) self.assertIn(composer_1, dictionary_of_every_composer) self.assertIn(composer_2, dictionary_of_every_composer) self.assertIn(composer_3, dictionary_of_every_composer) self.assertIn(score_1, dictionary_of_every_composer.get(composer_1)) self.assertIn(score_2, dictionary_of_every_composer.get(composer_2)) self.assertIn(score_3, dictionary_of_every_composer.get(composer_3))