-
Notifications
You must be signed in to change notification settings - Fork 11
/
test_mainMenu.py
51 lines (33 loc) · 1.13 KB
/
test_mainMenu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Tests here?
import pytest
from game import checkFile, ConfigureMenu, printConfigMenu, printMenu, mainMenu
# Unit test for functional feature: Displaying menu
# @pytest.fixture
# def test_display_menu(capsys):
# printMenu()
# captured = capsys.readouterr()
# assert captured.out == "hello\n"
# Unit test for functional feature: Reading Maze
def test_read_maze():
test = mainMenu(1, 'cut')
assert test == "Reading maze."
# Unit test for functional feature: Load Maze
def test_view_maze():
test = mainMenu(2)
assert test == "Viewing maze."
# Unit test for functional feature: Play Maze
def test_play_maze():
test = mainMenu(3, 'cut')
assert test == "Playing maze game."
# Unit test for functional feature: Configuring maze
def test_configure_maze():
test = mainMenu(4, 'cut')
assert test == "Configuring current maze."
# Unit test for functional feature: Exit game
def test_mainMenu_exit():
test = mainMenu(0)
assert test == False
# Unit test for functional feature: Exit game
def test_mainMenu_input_error():
test = mainMenu(3123)
assert test == "Invalid option selected."