def test_iter1_file(): file = Files("iris") database = DatabaseSlim(file.list_int) sct = database.make_standard_code_table() Files.to_file(sct, "expected_iris_sct") res = slim("iris", 1) Files.to_file(res, "res_test_iter1_iris") print(res)
def test_iter0_file(): file = Files("iris") database = DatabaseSlim(file.list_int) expected = database.make_standard_code_table() res = slim("iris", 0) print(res) assert res == expected
def test_generate_candidate_sct(): db = [[2, 1, 3, 4], [1, 2, 4], [1, 2, 4], [1, 2, 4], [2, 4], [2, 4], [1], [1], [3]] database = DatabaseSlim(db) print(database) standard_code_table = database.make_standard_code_table() # code_table = standard_code_table.copy() res = slimalgo.generate_candidat(standard_code_table, standard_code_table) print(res)
def test_cover_default_sct(): db = [[2, 1, 3, 4], [1, 2, 4], [1, 2, 4], [1, 2, 4], [2, 4], [2, 4], [1], [1], [3]] database = DatabaseSlim(db) print(database) standard_code_table = database.make_standard_code_table() standard_code_table.calcul_usage(database) print(standard_code_table) for e in standard_code_table.patternMap.keys(): print(e.usagelist)
def test_cover2_default_sct(): db = [[2, 1, 3, 4], [1, 2, 4], [1, 2, 4], [1, 2, 4], [2, 4], [2, 4], [1], [1], [3]] database = DatabaseSlim(db) print(database) standard_code_table = database.make_standard_code_table() standard_code_table.calcul_usage() code_table = standard_code_table.copy() candidate_list = slimalgo.generate_candidat(code_table, standard_code_table) candidate_list = sorted(candidate_list, key=lambda p: (p.usage), reverse=True) code_table.add(candidate_list[0], None) print("CT") print(code_table) print(">>>>>>>>>>>>>>>>>>>>>>>>") code_table.calcul_usage() print(code_table) print("STANDARD") print(standard_code_table) for e in standard_code_table.patternMap.keys(): print(e.usage_list)
def test_iter1_file_correct(): file = Files("iris") database = DatabaseSlim(file.list_int) sct = database.make_standard_code_table() res = slim("iris", 1) print(res)