From 4ba7d1787417d0e1dd8ce48baf04ab5b28379c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Mo=C5=BEina?= Date: Thu, 23 Mar 2017 15:04:27 +0100 Subject: Fixed tests in palindromic_numbers. --- .../problems/functions/palindromic_numbers/common.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/python/problems/functions/palindromic_numbers/common.py b/python/problems/functions/palindromic_numbers/common.py index 494e2d0..6ebf93f 100644 --- a/python/problems/functions/palindromic_numbers/common.py +++ b/python/problems/functions/palindromic_numbers/common.py @@ -8,7 +8,7 @@ number = 8 visible = True solution = '''\ -def palindromic_numbers(): +def palindromic_number(): xs = [] for i in range(100, 1000): for j in range(100, 1000): @@ -22,23 +22,13 @@ hint_type = { } def test(python, code, aux_code=''): - func_name = 'numbers' + func_name = 'palindromic_number' tokens = get_tokens(code) if not has_token_sequence(tokens, ['def', func_name]): return False, [{'id' : 'no_func_name', 'args' : {'func_name' : func_name}}] - in_out = [ - (906609, True), - (123456, False), - (1, True), - (11, True), - (12, False), - (113, False), - (131, True) - ] - - test_in = [(func_name+'(%s)'%str(l[0]), None) for l in in_out] - test_out = [l[1] for l in in_out] + test_in = [(func_name+'()', None)] + test_out = [906609] answers = python(code=aux_code+code, inputs=test_in, timeout=1.0) n_correct = 0 -- cgit v1.2.1