beets/test/test_util.py
Bruno Cauet 5d9128aff3 util.interactive_open() return open/xdg-open/start
Depending on the platform return the correct automatic execution
command.
2015-02-16 11:35:13 +01:00

23 lines
615 B
Python

from test._common import unittest
from test import _common
from beets import util
class UtilTest(unittest.TestCase):
def test_open_anything(self):
with _common.system_mock('Windows'):
self.assertEqual(util.open_anything(), 'start')
with _common.system_mock('Darwin'):
self.assertEqual(util.open_anything(), 'open')
with _common.system_mock('Tagada'):
self.assertEqual(util.open_anything(), 'xdg-open')
def suite():
return unittest.TestLoader().loadTestsFromName(__name__)
if __name__ == b'__main__':
unittest.main(defaultTest='suite')