diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-05-24 19:54:04 -0700 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-05-24 19:54:04 -0700 |
| commit | ebe1fe6fe8a1204117092beaa459f763db292006 (patch) | |
| tree | 268d9ef01428e0bd1934c317236ca042ce10573d /client/test.py | |
| parent | d58ab345b6995a780ffef5bfb5a5b22003e65c92 (diff) | |
| download | jasper-client-ebe1fe6fe8a1204117092beaa459f763db292006.tar.gz jasper-client-ebe1fe6fe8a1204117092beaa459f763db292006.zip | |
reverse sorting for unit testing
Diffstat (limited to 'client/test.py')
| -rw-r--r-- | client/test.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/client/test.py b/client/test.py index a9c5136..7954f8a 100644 --- a/client/test.py +++ b/client/test.py @@ -117,8 +117,9 @@ class TestBrain(unittest.TestCase): def testSortByPriority(self): """Does Brain sort modules by priority?""" my_brain = TestBrain._emptyBrain() - with_priority = filter(lambda m: hasattr(m, 'PRIORITY'), my_brain.modules) - self.assertEqual(sorted(with_priority, key=lambda m: m.PRIORITY), with_priority) + priorities = filter(lambda m: hasattr(m, 'PRIORITY'), my_brain.modules) + target = sorted(priorities, key=lambda m: m.PRIORITY, reverse=True) + self.assertEqual(target, priorities) def testPriority(self): """Does Brain correctly send query to higher-priority module?""" |
