-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Correct logic & typing of Surface.draw_texture * Remove exception on position != 0, 0 per review * Correct alpha value * Add simple test for NotImplementedErrors on unsupported arguments * Fix grammar & include value in exception strings
- Loading branch information
Showing
2 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import pytest | ||
|
||
from arcade import load_texture | ||
from arcade.gui import Surface, NinePatchTexture | ||
|
||
|
||
def test_surface_draw_texture_raises_not_implemented_error_on_unsupported_values(window): | ||
ninepatch_tx = NinePatchTexture( | ||
left=5, | ||
right=5, | ||
top=5, | ||
bottom=5, | ||
texture=load_texture( | ||
":resources:gui_basic_assets/window/dark_blue_gray_panel.png" | ||
)) | ||
surface = Surface(size=(100, 100)) | ||
|
||
def keywords_only(**kwargs): | ||
surface.draw_texture(0, 0, 20, 20, ninepatch_tx, **kwargs) | ||
|
||
with pytest.raises(NotImplementedError): | ||
keywords_only(alpha=128) | ||
|
||
with pytest.raises(NotImplementedError): | ||
keywords_only(angle=30.0) | ||
|
||
with pytest.raises(NotImplementedError): | ||
keywords_only(alpha=10, angle=30.0) | ||
|
||
|
||
|
||
|
||
|