Exemplo n.º 1
0
    def test_empty_minefield(self):
        """Test game methods with an empty minefield."""
        game = Game(minefield=Minefield(x_size=4, y_size=5, mines=0),
                    first_success=False)
        assert game.mf.bbbv == 1

        # Zero mines, no flags.
        assert game.get_flag_proportion() == 0
        # Zero mines, one flag.
        game.set_cell_flags((0, 0), 1)
        assert game.get_flag_proportion() == math.inf

        game.set_cell_flags((0, 0), 0)
        game.select_cell((0, 0))
        assert game.state is GameState.WON
        assert game.get_elapsed() == 0
        assert game.get_3bvps() == math.inf
        assert game.get_flag_proportion() == 0