From 893bcdbc388eb7bc5c59fe92f461fc20c7343dec Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 21 Jun 2014 21:18:44 +0000 Subject: Fixed /boot unit test. --- boot/test.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'boot') 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) -- cgit v1.3.1