-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import pytest | ||
|
||
from gopro_overlay.dimensions import Dimension | ||
from gopro_overlay.point import Coordinate | ||
from gopro_overlay.widgets.asi import AirspeedIndicator | ||
from gopro_overlay.widgets.msi import MotorspeedIndicator | ||
from gopro_overlay.widgets.widgets import Translate | ||
from tests.widgets import test_widgets_setup | ||
from tests.approval import approve_image | ||
from tests.widgets.test_widgets import time_rendering | ||
|
||
font = test_widgets_setup.font | ||
ts = test_widgets_setup.ts | ||
|
||
|
||
@pytest.mark.gfx | ||
@approve_image | ||
def test_gauge(): | ||
size = 256 | ||
return time_rendering( | ||
name="test_gauge", | ||
dimensions=Dimension(size, size), | ||
widgets=[ | ||
MotorspeedIndicator( | ||
size=size, font=font, green=40, yellow=46, end=200, | ||
needle=1, | ||
reading=lambda: 125 | ||
) | ||
] | ||
) | ||
|
||
|
||
@pytest.mark.gfx | ||
@approve_image | ||
def test_gauge_rotate_90(): | ||
size = 256 | ||
return time_rendering( | ||
name="test_gauge_rotate_90", | ||
dimensions=Dimension(size, size), | ||
widgets=[ | ||
MotorspeedIndicator( | ||
size=size, font=font, green=40, yellow=46, end=200, | ||
needle=1, | ||
rotate=90, | ||
reading=lambda: 125 | ||
) | ||
] | ||
) | ||
|
||
|
||
@pytest.mark.gfx | ||
@approve_image | ||
def test_no_needle(): | ||
size = 256 | ||
return time_rendering( | ||
name="test_gauge", | ||
dimensions=Dimension(size, size), | ||
widgets=[ | ||
MotorspeedIndicator( | ||
size=size, font=font, green=40, yellow=46, end=200, | ||
needle=0, | ||
reading=lambda: 125 | ||
) | ||
] | ||
) |