| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- # jogai - Python Game Library
- #
- # This library is free software; you can redistribute it and/or
- # modify it under the terms of the GNU Library General Public
- # License as published by the Free Software Foundation; either
- # version 2 of the License, or (at your option) any later version.
- #
- # This library is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # Library General Public License for more details.
- #
- # You should have received a copy of the GNU Library General Public
- # License along with this library; if not, write to the Free
- # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- #
- # Ramón Palleiro Rodríguez
- # Zero! Factorial Studio
- # info@zero.gal
- import pytest
- from pytest import mark
- from jogai import exceptions, utils
- def test_dict_to_kwargs_string_with_wrong_type():
- input = 'foo'
- assert utils.dict_to_kwargs_string(input) == input
- def test_eval_key():
- key = 'a'
- assert utils.eval_key(key) == ord(key)
- def test_eval_key_with_wrong_type():
- with pytest.raises(exceptions.KeyPressedNotFoundError):
- utils.eval_key({'foo': 'bar'})
- def test_load_image_with_wrong_types():
- with pytest.raises(TypeError):
- utils._load_image(-1, -1)
- def test_load_not_found_image():
- with pytest.raises(FileNotFoundError):
- utils._load_image('none', 'none.png')
- def test_load_image_with_wrong_file_format():
- with pytest.raises(exceptions.UnsupportedFileFormatError):
- utils._load_image('data', '01.yaml')
- """
- def test_convert_function_argumens_to_string_with_wrong_type():
- utils._convert_function_arguments_to_string()
- """
|