|
|
@@ -36,6 +36,11 @@ def test_wrong_predefined_keys_type():
|
|
|
ch = character.Character('protagonist.png', predefined_keys=[])
|
|
|
|
|
|
|
|
|
+def test_update_rect_position_with_wrong_type(prepare_videogame):
|
|
|
+ with pytest.raises(TypeError):
|
|
|
+ protagonist._update_rect_position(vgscene, 'foo')
|
|
|
+
|
|
|
+
|
|
|
def test_move_with_wrong_coordinates(prepare_videogame):
|
|
|
with pytest.raises(TypeError):
|
|
|
protagonist.move('foo', 'bar')
|
|
|
@@ -46,6 +51,24 @@ def test_move_with_wrong_key(prepare_videogame):
|
|
|
protagonist.move(5, 3, 1)
|
|
|
|
|
|
|
|
|
+def test_decrease_with_integer_argument(prepare_videogame):
|
|
|
+ protagonist.decrease(2)
|
|
|
+
|
|
|
+
|
|
|
+def test_decrease_with_wrong_type(prepare_videogame):
|
|
|
+ with pytest.raises(TypeError):
|
|
|
+ protagonist.decrease('foo')
|
|
|
+
|
|
|
+
|
|
|
+def test_increase_with_integer_argument(prepare_videogame):
|
|
|
+ protagonist.increase(2)
|
|
|
+
|
|
|
+
|
|
|
+def test_increase_with_wrong_type(prepare_videogame):
|
|
|
+ with pytest.raises(TypeError):
|
|
|
+ protagonist.increase('foo')
|
|
|
+
|
|
|
+
|
|
|
def test_scale_with_wrong_factor_type(prepare_videogame):
|
|
|
with pytest.raises(TypeError):
|
|
|
protagonist.scale_to('foo')
|
|
|
@@ -66,11 +89,21 @@ def test_set_height_with_a_negative_amount(prepare_videogame):
|
|
|
protagonist.set_height(-1)
|
|
|
|
|
|
|
|
|
+def test_set_keys_with_wrong_type(prepare_videogame):
|
|
|
+ with pytest.raises(TypeError):
|
|
|
+ protagonist.set_keys('foo')
|
|
|
+
|
|
|
+
|
|
|
def test_set_position_with_wrong_types(prepare_videogame):
|
|
|
with pytest.raises(TypeError):
|
|
|
protagonist.set_position('foo', 'bar')
|
|
|
|
|
|
|
|
|
+def test_set_position_with_wrong_number_of_parameters(prepare_videogame):
|
|
|
+ with pytest.raises(ValueError):
|
|
|
+ protagonist.set_position((2, 3, 4))
|
|
|
+
|
|
|
+
|
|
|
def test_set_width_with_wrong_type(prepare_videogame):
|
|
|
with pytest.raises(TypeError):
|
|
|
protagonist.set_width('a')
|