diff --git a/SprintLib/testers/BaseTester.py b/SprintLib/testers/BaseTester.py index 6930c75..74691da 100644 --- a/SprintLib/testers/BaseTester.py +++ b/SprintLib/testers/BaseTester.py @@ -1,6 +1,5 @@ from os import listdir, mkdir from os.path import join, exists -from shutil import copyfile, rmtree from subprocess import call, TimeoutExpired from Main.management.commands.bot import bot @@ -62,10 +61,10 @@ class BaseTester: for file in SolutionFile.objects.filter(solution=self.solution): dirs = file.path.split('/') for i in range(len(dirs) - 1): - name = join(str(self.solution.id), '/'.join(dirs[:i + 1])) + name = join(str("solutions/" + self.solution.id), '/'.join(dirs[:i + 1])) if not exists(name): mkdir(name) - with open(join(str(self.solution.id), file.path), 'wb') as fs: + with open(join("solutions/" + str(self.solution.id), file.path), 'wb') as fs: fs.write(get_bytes(file.fs_id)) self.solution.result = CONSTS["testing_status"] self.solution.save() @@ -74,7 +73,7 @@ class BaseTester: call(docker_command, shell=True) print("Container created") for file in ExtraFile.objects.filter(task=self.solution.task): - with open(join(str(self.solution.id), file.filename), 'wb') as fs: + with open(join("solutions/" + str(self.solution.id), file.filename), 'wb') as fs: fs.write(get_bytes(file.fs_id)) print("Files copied") try: