From e6eaa6105c450b581d853ee97eb6b44296ab87a3 Mon Sep 17 00:00:00 2001 From: Tue Herlau <tuhe@dtu.dk> Date: Thu, 13 Jul 2023 15:14:27 +0200 Subject: [PATCH] Fixed test suite --- tests/demo1_correct/code/tree.py | 7 ------- tests/demo1_correct/output/tree_myfile.py | 1 - tests/demo1_correct/output/tree_myfile_stripped.py | 1 - tests/setup_test_files.py | 5 +++-- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/demo1_correct/code/tree.py b/tests/demo1_correct/code/tree.py index f4ad1f7..cf12a7b 100644 --- a/tests/demo1_correct/code/tree.py +++ b/tests/demo1_correct/code/tree.py @@ -5,7 +5,6 @@ class TreeNode(object): # TODO: 3 lines missing. raise NotImplementedError("Insert your solution and remove this error.") -#!s=a def sorted_array_to_bst(nums): # TODO: 4 lines missing. raise NotImplementedError("Your stuff here") @@ -15,7 +14,6 @@ def sorted_array_to_bst(nums): raise NotImplementedError("Here") print("hello world asdfasd") -#!o=a def preOrder(node): if not node: # TODO: 1 lines missing. @@ -25,21 +23,16 @@ def preOrder(node): preOrder(node.right) for _ in range(10): print("Hello world") -#!o=a a = 234 result = sorted_array_to_bst([1, 2, 3, 4, 5, 6, 7]) preOrder(result) -#!i=a for _ in range(10): print("hi") -#!i=a -#!i=b print("hello") def myfun(a): return a*2 print(myfun(4)) -#!i=b diff --git a/tests/demo1_correct/output/tree_myfile.py b/tests/demo1_correct/output/tree_myfile.py index 900f89b..d06d5ff 100644 --- a/tests/demo1_correct/output/tree_myfile.py +++ b/tests/demo1_correct/output/tree_myfile.py @@ -7,7 +7,6 @@ return node print("hello world asdfasd") -#!o=a def preOrder(node): if not node: return diff --git a/tests/demo1_correct/output/tree_myfile_stripped.py b/tests/demo1_correct/output/tree_myfile_stripped.py index 900f89b..d06d5ff 100644 --- a/tests/demo1_correct/output/tree_myfile_stripped.py +++ b/tests/demo1_correct/output/tree_myfile_stripped.py @@ -7,7 +7,6 @@ return node print("hello world asdfasd") -#!o=a def preOrder(node): if not node: return diff --git a/tests/setup_test_files.py b/tests/setup_test_files.py index 4181e12..918f4ef 100644 --- a/tests/setup_test_files.py +++ b/tests/setup_test_files.py @@ -1,5 +1,6 @@ import os.path import shutil +dir = os.path.dirname(__file__) def setup(source, dest): @@ -33,8 +34,8 @@ if __name__ == "__main__": # if not os.path.isdir("student_correct_output"): # os.mkdir("student_correct_output") for file in ['demo1']: - setup(file, file+"_correct") - setup_keep("demo2/framework.py", "demo2/framework_correct.txt") + setup(dir+"/" + file, dir+"/" + file+"_correct") + setup_keep(dir+"/demo2/framework.py", dir+"/demo2/framework_correct.txt") a= 234 # assert False -- GitLab