def test_make_dict_from_list(): testlist = ['a', 'b'] resultdict = make_dict_from_list(testlist) assert isinstance(resultdict, dict), 'type is not dict' assert resultdict == {'0': 'a', '1': 'b'}, 'dict not correct'
def get_signature_paths(sig_dir): sig_files = get_files_in_dir(sig_dir) signature_paths = make_dict_from_list(sig_files) if len(signature_paths) == 0: logging.error("no signature file found in {}".format(signature_paths)) return signature_paths
def test_make_dict_from_list(self): testlist = ['a', 'b'] resultdict = make_dict_from_list(testlist) self.assertIsInstance(resultdict, dict, "type is not dict") self.assertEqual(resultdict, {'0': 'a', '1': 'b'}, "dict not correct")