From 6b9d3511b99cb980726c00b8909e4b8f5c23fefc Mon Sep 17 00:00:00 2001 From: vky Date: Sat, 25 Jun 2022 22:27:43 +0200 Subject: [PATCH] updated spidey test --- modules/spidey_test.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/spidey_test.py b/modules/spidey_test.py index b3fa3f8..56ca2e4 100644 --- a/modules/spidey_test.py +++ b/modules/spidey_test.py @@ -25,20 +25,22 @@ class SpideyTest(test_template.TestTemplate): self.is_infected = False lines = 0 with open(os.path.join(paths[0], "index.js")) as f: - for line in f: - lines += 1 # TODO: you don't actually need to count the lines, you can just check if it's more than 1 - if lines > 1: - self.is_infected = True + for _ in f: + lines += 1 + if lines > 1: + self.is_infected = True + break self.progress = 50 # time.sleep(5) lines = 0 with open(os.path.join(paths[1], "index.js")) as f: - for line in f: - lines += 1 # TODO: you don't actually need to count the lines, you can just check if it's more than 1 - if lines > 1: - self.is_infected = True + for _ in f: + lines += 1 + if lines > 1: + self.is_infected = True + break # self.is_infected = True if self.is_infected: # TODO: set a status here, explaining and why the test failed, the scary part will be handled by the main program