summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-09-09 08:11:51 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2014-09-09 13:57:46 +0100
commit6d4a3fb3358c7f0f20ffa2ce859c4f54e1ef0be3 (patch)
tree132c0e13ac26a0afbc0f9d19d618f560ba7cbe1a /client
parent9c72e7349676b719118e7f98dc0f7d142cc80ab4 (diff)
downloadjasper-client-6d4a3fb3358c7f0f20ffa2ce859c4f54e1ef0be3.tar.gz
jasper-client-6d4a3fb3358c7f0f20ffa2ce859c4f54e1ef0be3.zip
Added travis
Diffstat (limited to 'client')
-rw-r--r--client/test.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/client/test.py b/client/test.py
index 29b9ce0..7797058 100644
--- a/client/test.py
+++ b/client/test.py
@@ -1,4 +1,5 @@
import os
+import sys
if os.environ.get('JASPER_HOME') is None:
os.environ['JASPER_HOME'] = '/home/pi'
@@ -12,6 +13,11 @@ import test_mic
import g2p
import brain
+DEFAULT_PROFILE = {
+ 'prefers_email': False,
+ 'location': 'travis',
+ 'phone_number': '012344321'
+ }
def activeInternet():
try:
@@ -65,7 +71,7 @@ class TestG2P(unittest.TestCase):
class TestModules(unittest.TestCase):
def setUp(self):
- self.profile = yaml.safe_load(open("profile.yml", "r"))
+ self.profile = DEFAULT_PROFILE
self.send = False
def runConversation(self, query, inputs, module):
@@ -162,7 +168,7 @@ class TestBrain(unittest.TestCase):
@staticmethod
def _emptyBrain():
mic = test_mic.Mic([])
- profile = yaml.safe_load(open("profile.yml", "r"))
+ profile = DEFAULT_PROFILE
return brain.Brain(mic, profile)
@patch.object(brain, 'logError')
@@ -210,4 +216,7 @@ if __name__ == '__main__':
for test_case in test_cases:
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(test_case))
- unittest.TextTestRunner(verbosity=2).run(suite)
+ result = unittest.TextTestRunner(verbosity=2).run(suite)
+
+ if not result.wasSuccessful():
+ sys.exit("Tests failed")