-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bail out when kivy is missing a video provider (#267)
* bail out when kivy is missing a video provider * add small video integration test * fix integration tests with current dev
- Loading branch information
Showing
6 changed files
with
64 additions
and
1 deletion.
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
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,9 @@ | ||
#config_version=4 | ||
|
||
displays: | ||
default: | ||
width: 400 | ||
height: 300 | ||
|
||
modes: | ||
- mode1 |
18 changes: 18 additions & 0 deletions
18
mpfmc/integration/machine_files/video/modes/mode1/config/mode1.yaml
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,18 @@ | ||
#config_version=4 | ||
|
||
mode: | ||
priority: 100 | ||
start_events: start_mode1 | ||
stop_events: stop_mode1 | ||
game_mode: false | ||
|
||
|
||
slide_player: | ||
mode_mode1_started: | ||
mode1_slide1: | ||
widgets: | ||
- type: video | ||
video: mpf_video_small_test2 | ||
- type: text | ||
text: Video from Mode | ||
y: bottom+20% |
Binary file added
BIN
+655 KB
...c/integration/machine_files/video/modes/mode1/videos/mode_start/mpf_video_small_test2.mp4
Binary file not shown.
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,27 @@ | ||
import time | ||
|
||
from mpfmc.tests.MpfIntegrationTestCase import MpfIntegrationTestCase | ||
|
||
|
||
class TestVideo(MpfIntegrationTestCase): | ||
|
||
def getMachinePath(self): | ||
return 'integration/machine_files/video' | ||
|
||
def getConfigFile(self): | ||
return 'config.yaml' | ||
|
||
def test_video_stops_on_slide_removal(self): | ||
# start mode1, its slide with video should come up | ||
self.post_event("start_mode1") | ||
self.advance_time_and_run() | ||
|
||
self.assertEqual(self.mc.targets['default'].current_slide.name, 'mode1_slide1') | ||
video_widget = self.mc.targets['default'].current_slide.children[0].children[0] | ||
self.assertEqual(video_widget.state, 'play') | ||
|
||
# stop mode 1, should unload the slide | ||
self.post_event("stop_mode1") | ||
self.advance_time_and_run() | ||
self.assertEqual(self.mc.targets['default'].current_slide.name, 'default_blank') | ||
self.assertEqual(video_widget.state, 'stop') |