test_utils.py 709 B

12345678910111213141516171819202122232425262728293031
  1. import pytest
  2. from pytest import mark
  3. from jogai import exceptions, utils
  4. @mark.xfail
  5. @mark.parametrize('key', ['', 'foo', 'K_', -1, 0, None])
  6. def test_eval_key(key):
  7. utils.eval_key(key)
  8. def test_load_image_with_wrong_types():
  9. with pytest.raises(TypeError):
  10. utils._load_image(-1, -1)
  11. def test_load_not_found_image():
  12. with pytest.raises(FileNotFoundError):
  13. utils._load_image('none', 'none.png')
  14. def test_load_image_with_wrong_file_format():
  15. with pytest.raises(exceptions.UnsupportedFileFormatError):
  16. utils._load_image('data', '01.yaml')
  17. """
  18. def test_convert_function_argumens_to_string_with_wrong_type():
  19. utils._convert_function_arguments_to_string()
  20. """