import pytest from jogai import * def test_random_group_with_amount_wrong_type(prepare_videogame): with pytest.raises(TypeError): RandomGroup(protagonist, 'foo', (0, 200), (0, 200)) def test_random_group_with_ranges_wrong_type(prepare_videogame): with pytest.raises(TypeError): RandomGroup(protagonist, 2, 'bar', 'foo') def test_random_group_with_amount_not_greater_than_1(prepare_videogame): with pytest.raises(ValueError): RandomGroup(protagonist, -1, (0, 200), (0, 200)) def test_random_group_with_wrong_length_ranges(prepare_videogame): with pytest.raises(ValueError): RandomGroup(protagonist, 3, (1, 2, 3), (1, 2, 3)) def test_random_group_with_min_greater_than_max_range(prepare_videogame): with pytest.raises(ValueError): RandomGroup(protagonist, 3, (100, 3), (100, 3)) def test_random_group_with_lists(prepare_videogame): RandomGroup(protagonist, 3, [0, 200], [0, 200]) def test_rectangle_group_with_wrong_sides_type(prepare_videogame): with pytest.raises(TypeError): RectangleGroup(protagonist, 'foo', 'bar') def test_rectangle_group_with_sides_out_of_range(prepare_videogame): with pytest.raises(ValueError): RectangleGroup(protagonist, -1, 3) def test_rectangle_group_with_both_sides_equal_to_1(prepare_videogame): with pytest.raises(ValueError): RectangleGroup(protagonist, 1, 1) def test_square_group_with_wrong_side_type(prepare_videogame): with pytest.raises(TypeError): SquareGroup(protagonist, 'foo') def test_square_group_with_side_out_of_range(prepare_videogame): with pytest.raises(ValueError): SquareGroup(protagonist, -1) def test_stairs_group_with_wrong_steps_type(prepare_videogame): with pytest.raises(TypeError): StairsGroup(protagonist, 'foo') def test_stairs_group_with_steps_out_of_range(prepare_videogame): with pytest.raises(ValueError): StairsGroup(protagonist, -1) def test_stairs_group_with_horizontal_and_vertical_flip_wrong_type( prepare_videogame, ): with pytest.raises(TypeError): StairsGroup(protagonist, 3, 'foo', 'bar')