test_utils.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # jogai - Python Game Library
  2. #
  3. # This library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Library General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2 of the License, or (at your option) any later version.
  7. #
  8. # This library is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Library General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU Library General Public
  14. # License along with this library; if not, write to the Free
  15. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. #
  17. # Ramón Palleiro Rodríguez
  18. # Zero! Factorial Studio
  19. # info@zero.gal
  20. import pytest
  21. from pytest import mark
  22. from jogai import exceptions, utils
  23. @mark.xfail
  24. @mark.parametrize('key', ['', 'foo', 'K_', -1, 0, None])
  25. def test_eval_key(key):
  26. utils.eval_key(key)
  27. def test_load_image_with_wrong_types():
  28. with pytest.raises(TypeError):
  29. utils._load_image(-1, -1)
  30. def test_load_not_found_image():
  31. with pytest.raises(FileNotFoundError):
  32. utils._load_image('none', 'none.png')
  33. def test_load_image_with_wrong_file_format():
  34. with pytest.raises(exceptions.UnsupportedFileFormatError):
  35. utils._load_image('data', '01.yaml')
  36. """
  37. def test_convert_function_argumens_to_string_with_wrong_type():
  38. utils._convert_function_arguments_to_string()
  39. """