~ubuntu-branches/debian/stretch/electrum/stretch

« back to all changes in this revision

Viewing changes to gui/kivy/tools/.buildozer/android/platform/python-for-android/dist/kivy/python-install/lib/python2.7/site-packages/kivy/tests/test_video.py

  • Committer: Package Import Robot
  • Author(s): Tristan Seligmann
  • Date: 2016-04-04 03:02:39 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20160404030239-0szgkio8yryjv7c9
Tags: 2.6.3-1
* New upstream release.
  - Drop backported install-wizard-connect.patch.
* Add Suggests: python-zbar and update the installation hint to suggest
  apt-get instead of pip (closes: #819517).
* Bump Standards-Version to 3.9.7 (no changes).
* Update Vcs-* links.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
import unittest
 
3
 
 
4
 
 
5
class AnimationTestCase(unittest.TestCase):
 
6
 
 
7
    def test_video_unload(self):
 
8
        # fix issue https://github.com/kivy/kivy/issues/2275
 
9
        # AttributeError: 'NoneType' object has no attribute 'texture'
 
10
        from kivy.uix.video import Video
 
11
        from kivy.clock import Clock
 
12
        from kivy.base import runTouchApp, stopTouchApp
 
13
        from os.path import join, dirname, abspath
 
14
        here = dirname(__file__)
 
15
        source = abspath(join(
 
16
            here, "..", "..", "examples", "widgets", "softboy.mpg"))
 
17
        video = Video(source=source, play=True)
 
18
        Clock.schedule_once(lambda x: stopTouchApp(), 1)
 
19
 
 
20
        def unload_video(video, position):
 
21
            if position > 0.01:
 
22
                video.unload()
 
23
                Clock.schedule_once(lambda x: stopTouchApp(), 0.1)
 
24
 
 
25
        video.bind(position=unload_video)
 
26
        runTouchApp(video)