summaryrefslogtreecommitdiff
path: root/client/test.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-10-06 18:41:50 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2014-10-06 18:41:50 +0200
commit68704f36d7c05e06ffdf65e2593aa296ffd3a64d (patch)
tree6c6a5e30b7254dd82a25d2d8a0f3f4c6c7cc7fe5 /client/test.py
parent2915c50df177767ad222db1101a9e20f76deaf01 (diff)
downloadjasper-client-68704f36d7c05e06ffdf65e2593aa296ffd3a64d.tar.gz
jasper-client-68704f36d7c05e06ffdf65e2593aa296ffd3a64d.zip
Add testcase for diagnose.py's python import check
Diffstat (limited to 'client/test.py')
-rw-r--r--client/test.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/test.py b/client/test.py
index d774eb7..6858700 100644
--- a/client/test.py
+++ b/client/test.py
@@ -107,6 +107,14 @@ class TestG2P(unittest.TestCase):
self.assertEqual(g2p.translateWords(words), translations)
+class TestDiagnose(unittest.TestCase):
+ def testPythonImportCheck(self):
+ # This a python stdlib module that definitely exists
+ self.assertTrue(diagnose.check_python_import("os"))
+ # I sincerly hope nobody will ever create a package with that name
+ self.assertFalse(diagnose.check_python_import("nonexistant_package"))
+
+
class TestModules(unittest.TestCase):
def setUp(self):
@@ -267,7 +275,8 @@ if __name__ == '__main__':
# Change CWD to jasperpath.LIB_PATH
os.chdir(jasperpath.LIB_PATH)
- test_cases = [TestBrain, TestModules, TestVocabCompiler, TestTTS]
+ test_cases = [TestBrain, TestModules, TestVocabCompiler, TestTTS,
+ TestDiagnose]
if not args.light:
test_cases.append(TestG2P)
test_cases.append(TestMic)