diff options
| -rw-r--r-- | boot/test.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/boot/test.py b/boot/test.py index c6bd3ff..4c79f39 100644 --- a/boot/test.py +++ b/boot/test.py @@ -1,6 +1,11 @@ import os + +if os.environ.get('JASPER_HOME') is None: + os.environ['JASPER_HOME'] = '/home/pi' + import sys import unittest +from sets import Set from mock import patch import vocabcompiler @@ -12,6 +17,10 @@ sys.path.append(mod_path) import g2p +class ListWhereOrderDoesNotMatter(list): + def __eq__(self, other): + return sorted(self) == sorted(other) + class TestVocabCompiler(unittest.TestCase): @@ -33,7 +42,7 @@ class TestVocabCompiler(unittest.TestCase): # 'words' is appended with ['MUSIC', 'SPOTIFY'] # so must be > 2 to have received WORDS from modules - translateWords.assert_called_once_with(words) + translateWords.assert_called_once_with(ListWhereOrderDoesNotMatter(words)) self.assertTrue(text2lm.called) os.remove(sentences) os.remove(dictionary) |
