summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2014-06-21 21:18:44 +0000
committerschneefux <schneefux+commit@schneefux.xyz>2014-06-21 21:18:44 +0000
commit893bcdbc388eb7bc5c59fe92f461fc20c7343dec (patch)
tree202e30b0f20200a193136d33c89c5841a499dc30
parent18c02563c04f77e1732194d74e537787247918b9 (diff)
downloadjasper-client-893bcdbc388eb7bc5c59fe92f461fc20c7343dec.tar.gz
jasper-client-893bcdbc388eb7bc5c59fe92f461fc20c7343dec.zip
Fixed /boot unit test.
-rw-r--r--boot/test.py11
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)