def load_dictionary(self, filepath): try: self.dict = FileHandler.load_data(filepath, FileExtensions.Json) except FileNotFoundError: print('Invalid file path') except: print('Unknown exception occurred')
def load_dictionary(self, filepath): """ Loads dictionary from file at filepath :param filepath: :return: None """ extension = Path(filepath).suffix self._dictionary = FileHandler.load_data(filepath, extension) self._is_loaded = True
def test_load_data(self): data = FileHandler.load_data('data.json', FileExtensions.Json) self.assertIsNotNone(data)