test_scene.py 608 B

12345678910111213141516171819202122232425262728
  1. import os
  2. import pytest
  3. from jogai import *
  4. def test_change_background_color_with_components_out_of_range():
  5. with pytest.raises(ValueError):
  6. sc = Scene()
  7. sc.change_background((-1, -1, 300))
  8. def test_change_background_color_with_less_components():
  9. with pytest.raises(ValueError):
  10. sc = Scene()
  11. sc.change_background((0, 0))
  12. def test_change_background_color_wrong_type():
  13. with pytest.raises(ValueError):
  14. sc = Scene()
  15. sc.change_background('a')
  16. def test_create_scene_with_wrong_type():
  17. with pytest.raises(TypeError):
  18. sc = Scene(-1)