Skip to content

Commit

Permalink
Final optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Aug 23, 2024
1 parent 6e428f7 commit 49de87e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 42 deletions.
28 changes: 0 additions & 28 deletions game/end_to_end_tests/base_game_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,34 +152,6 @@ def run_crashing_test(self, level, workspace_file):
.run_crashing_program()
)

def run_python_commands_test(self, level):
return self.go_to_level(
level, from_python_den=True
).check_python_commands()

def run_clear_console_test(self, level):
return self.go_to_level(
level, from_python_den=True
).write_to_then_clear_console()

def run_console_parse_error_test(self, level):
return self.go_to_level(
level, from_python_den=True
).run_parse_error_program()

def run_console_attribute_error_test(self, level):
return self.go_to_level(
level, from_python_den=True
).run_attribute_error_program()

def run_console_print_test(self, level):
return self.go_to_level(level, from_python_den=True).run_print_program()

def run_invalid_import_test(self, level):
return self.go_to_level(
level, from_python_den=True
).run_invalid_import_program()

def run_animal_sound_horn_test(self, level):
return self.go_to_custom_level(level).run_animal_sound_horn_program()

Expand Down
12 changes: 6 additions & 6 deletions game/end_to_end_tests/test_python_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@

class TestPythonLevels(BaseGameTest):
def test_can_see_python_commands(self):
self.run_python_commands_test(level=4)
self.go_to_level(4, from_python_den=True).check_python_commands()

def test_clear_console(self):
self.run_clear_console_test(level=4)
self.go_to_level(4, from_python_den=True).write_to_then_clear_console()

def test_console_parse_error(self):
self.run_console_parse_error_test(level=4)
self.go_to_level(4, from_python_den=True).run_parse_error_program()

def test_console_attribute_error(self):
self.run_console_attribute_error_test(level=4)
self.go_to_level(4, from_python_den=True).run_attribute_error_program()

def test_console_print(self):
self.run_console_print_test(level=4)
self.go_to_level(4, from_python_den=True).run_print_program()

def test_invalid_import(self):
self.run_invalid_import_test(level=49)
self.go_to_level(49, from_python_den=True).run_invalid_import_program()

def test_run_code(self):
self.go_to_level(4, from_python_den=True)
Expand Down
8 changes: 0 additions & 8 deletions game/static/game/css/backgrounds.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
background-color: #f6be00;
}

.bg--split-python {
background-color: #213CE7;
}

.bg--python {
background-color: #152584;
}

.bg--early-python {
background-color: #213CE7;
}
Expand Down
10 changes: 10 additions & 0 deletions game/tests/test_level_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ def test_list_episodes(self):
== "Can you help the van get to the house?"
)

def test_list_python_episodes(self):
url = reverse("python_levels")
response = self.client.get(url)

assert response.status_code == 200
assert (
response.context["pythonEpisodes"][0]["name"]
== "Output, Operators, and Data"
)

def test_custom_levels_access(self):
email1, password1 = signup_teacher_directly()
email2, password2 = signup_teacher_directly()
Expand Down

0 comments on commit 49de87e

Please sign in to comment.