Skip to content

Commit

Permalink
Add macOS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dagwieers committed Dec 23, 2019
1 parent 51d53f0 commit 89f4f95
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions test/test_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
class LinuxVendorTests(unittest.TestCase):

def setUp(self):
open('test/cdm/libwidevinecdm_vendor.so', 'w').write('Linux\n1.2.3.4')
with open('test/cdm/libwidevinecdm_vendor.so', 'w') as fdesc:
fdesc.write('Linux\n1.2.3.4')

def tearDown(self):
os.unlink('test/cdm/libwidevinecdm_vendor.so')
Expand Down Expand Up @@ -48,7 +49,8 @@ def test_about():
class WindowsVendorTests(unittest.TestCase):

def setUp(self):
open('test/cdm/widevinecdm_vendor.dll', 'w').write('Windows\n1.2.3.4')
with open('test/cdm/widevinecdm_vendor.dll', 'w') as fdesc:
fdesc.write('Windows\n1.2.3.4')

def tearDown(self):
os.unlink('test/cdm/widevinecdm_vendor.dll')
Expand All @@ -74,5 +76,34 @@ def test_about():
default.run(['default.py', 'info'])


class DarwinX64Tests(unittest.TestCase):

def setUp(self):
with open('test/cdm/libwidevinecdm_vendor.dylib', 'w') as fdesc:
fdesc.write('macOS\n1.2.3.4')

def tearDown(self):
os.unlink('test/cdm/libwidevinecdm_vendor.dylib')

def test_check_inputstream_mpd(self):
inputstreamhelper.system_os = lambda: 'Darwin'
platform.machine = lambda: 'x86_64'
is_helper = inputstreamhelper.Helper('mpd', drm='com.widevine.alpha')
is_helper.remove_widevine()
is_installed = is_helper.check_inputstream()
self.assertTrue(is_installed, True)

def test_check_inputstream_hls_again(self):
inputstreamhelper.system_os = lambda: 'Darwin'
platform.machine = lambda: 'x86_64'
is_helper = inputstreamhelper.Helper('hls', drm='com.widevine.alpha')
is_installed = is_helper.check_inputstream()
self.assertTrue(is_installed, True)

@staticmethod
def test_about():
default.run(['default.py', 'info'])


if __name__ == '__main__':
unittest.main()

0 comments on commit 89f4f95

Please sign in to comment.