summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2020-07-21 08:41:06 +0200
committerjaseg <code@jaseg.net>2020-07-21 08:41:06 +0200
commitd1f304ab9205ba220f45f5ff010f2dd55fa99740 (patch)
treeb5ac45594bb469c4d86fa9d22283013839bb2f76 /tests
parent170f15d39048bbe48ad46cf757a8bc6bdb3e50ce (diff)
downloadpython-mpv-d1f304ab9205ba220f45f5ff010f2dd55fa99740.tar.gz
python-mpv-d1f304ab9205ba220f45f5ff010f2dd55fa99740.tar.bz2
python-mpv-d1f304ab9205ba220f45f5ff010f2dd55fa99740.zip
tests: Make test srt path relative to test script
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_mpv.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_mpv.py b/tests/test_mpv.py
index b100995..b9120c0 100755
--- a/tests/test_mpv.py
+++ b/tests/test_mpv.py
@@ -60,6 +60,7 @@ def devnull_libmpv():
sys.stdout = io.TextIOWrapper(open(stdout_fd, 'wb', closefd=False))
TESTVID = os.path.join(os.path.dirname(__file__), 'test.webm')
+TESTSRT = os.path.join(os.path.dirname(__file__), 'sub_test.srt')
MPV_ERRORS = [ l(ec) for ec, l in mpv.ErrorCode.EXCEPTION_DICT.items() if l ]
class MpvTestCase(unittest.TestCase):
@@ -674,7 +675,7 @@ class CommandTests(MpvTestCase):
handler = mock.Mock()
self.m.property_observer('sub-text')(handler)
- self.m.loadfile(TESTVID, sub_file='tests/sub_test.srt')
+ self.m.loadfile(TESTVID, sub_file=TESTSRT)
self.m.wait_for_playback()
handler.assert_any_call('sub-text', 'This is\na subtitle test.')
@@ -686,7 +687,7 @@ class CommandTests(MpvTestCase):
self.m.loadfile(TESTVID)
self.m.wait_until_playing()
- self.m.sub_add('tests/sub_test.srt')
+ self.m.sub_add(TESTSRT)
self.m.wait_for_playback()
handler.assert_any_call('sub-text', 'This is\na subtitle test.')