import os import pytest from jogai import * def test_height_is_a_non_negative_integer(prepare_videogame): assert vgscene.height > -1 def test_width_is_a_non_negative_integer(prepare_videogame): assert vgscene.width > -1 def test_x_coordinate_is_an_integer(prepare_videogame): assert isinstance(vgscene.x, int) def test_change_background_color_with_components_out_of_range(): with pytest.raises(ValueError): sc = Scene() sc.change_background((-1, -1, 300)) def test_change_background_color_with_less_components(): with pytest.raises(ValueError): sc = Scene() sc.change_background((0, 0)) def test_change_background_color_wrong_type(): with pytest.raises(ValueError): sc = Scene() sc.change_background('a') def test_create_scene_with_wrong_type(): with pytest.raises(TypeError): sc = Scene(-1) def test_set_position_with_wrong_type(prepare_videogame): with pytest.raises(TypeError): vgscene.set_position('foo')