예제 #1
0
 def test_check_grid_configuration_input_8(self): # Appropriate number of mines
     assert check_grid_configuration_inputs('3', length_of_grid=9, height_of_grid=9, mine=True) == 3
예제 #2
0
 def test_check_grid_configuration_input_9(self):
     assert check_grid_configuration_inputs('3') == 3
예제 #3
0
 def test_check_grid_configuration_input_6(self): # Height NaN
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs('aaa')
예제 #4
0
 def test_check_grid_configuration_input_7(self): # Number of mines NaN
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs(' aa', length_of_grid=9, height_of_grid=9, mine=True)
예제 #5
0
 def test_check_grid_configuration_input_1(self): # Negative height and length
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs('-3')
예제 #6
0
 def test_check_grid_configuration_input_4(self): # Number of mines > grid_length*grid_height
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs('7', length_of_grid=2, height_of_grid=2, mine=True)
예제 #7
0
 def test_check_grid_configuration_input_14(self):
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs('0')
예제 #8
0
 def test_check_grid_configuration_input_14(self):
     with pytest.raises(InstructionError) as excinfo:
         check_grid_configuration_inputs('-4', length_of_grid=3, height_of_grid=None, mine=True)
예제 #9
0
 def test_check_grid_configuration_input_13(self):
     assert check_grid_configuration_inputs('4', length_of_grid=None, height_of_grid=None, mine=True) == 4
예제 #10
0
 def test_check_grid_configuration_input_11(self):
     assert check_grid_configuration_inputs('-1', length_of_grid=9, height_of_grid=9, mine=True) == None
예제 #11
0
 def test_check_grid_configuration_input_10(self):
     assert check_grid_configuration_inputs('-1') == None