aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_windows.py
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2021-09-07 14:02:34 -0500
committerGitHub <noreply@github.com>2021-09-07 22:02:34 +0300
commit92dccd0751fe3522095ab2eecb76efc696fb84d4 (patch)
treeb47df55a44873a750e22bef53476e4f6bfdd708e /tests/test_windows.py
parentRelease version 1.8.1 (diff)
downloadtaskipy2-92dccd0751fe3522095ab2eecb76efc696fb84d4.zip
Only use and install `mslex` on Windows (#36)
* Fix lint issues where encoding was not specified * Only use and install mslex on Windows * Escape backslash in test_windows * Alter Windows CI name Since we actually have some tests other than the path sanity test, it probably makes sense to just call it a Windows test now. * Disable pylint issue with mslex import It's raising an unable to import issue with that line, which makes sense since mslex wouldn't be installed on any other platform other than Windows, but it also wouldn't be run on any other platform so it seems to be a non issue. Co-authored-by: Eugene Triguba <etriguba@sonifi.com>
Diffstat (limited to 'tests/test_windows.py')
-rw-r--r--tests/test_windows.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_windows.py b/tests/test_windows.py
new file mode 100644
index 0000000..78ba69f
--- /dev/null
+++ b/tests/test_windows.py
@@ -0,0 +1,26 @@
+import platform
+
+import unittest
+
+
+@unittest.skipIf(platform.system() != 'Windows', 'Windows only tests')
+class WindowsTestCase(unittest.TestCase):
+ def test_windows_path_sanity(self):
+ '''
+ This test case is a no-op, and exists only to ensure that windows paths work
+ as part of the windows sanity ci test.
+ '''
+ print('sanity passed - test was run')
+
+ def test_mslex_install(self):
+ '''Ensure that mslex is installed on Windows'''
+ try:
+ import mslex # type: ignore # pylint: disable=W0611,C0415
+ except ImportError:
+ self.fail('Unable to import mslex')
+
+ def test_mslex_import(self):
+ '''Ensure that mslex is used as shlex'''
+ from taskipy.task_runner import shlex # pylint: disable=C0415
+
+ self.assertEqual(shlex.__name__, 'mslex')