diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-09 11:38:37 -0400 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-09 11:38:37 -0400 |
| commit | 5deb844e3eece693f7cc647c4ebbc42ef7a691a8 (patch) | |
| tree | 132c0e13ac26a0afbc0f9d19d618f560ba7cbe1a | |
| parent | 9c72e7349676b719118e7f98dc0f7d142cc80ab4 (diff) | |
| parent | 6d4a3fb3358c7f0f20ffa2ce859c4f54e1ef0be3 (diff) | |
| download | jasper-client-5deb844e3eece693f7cc647c4ebbc42ef7a691a8.tar.gz jasper-client-5deb844e3eece693f7cc647c4ebbc42ef7a691a8.zip | |
Merge pull request #158 from alexsiri7/travis
Added Travis support
| -rw-r--r-- | .travis.yml | 9 | ||||
| -rw-r--r-- | client/test.py | 15 |
2 files changed, 21 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..95079e7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: python + +env: + - ARCH=x86 + +script: + - "pip install -r client/requirements.txt" + - "cd client && python test.py --light" + - "cd ../boot && python test.py" 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") |
