mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Fix the tests for mircColor and sorted (Thanks dcraven)
This commit is contained in:
parent
a8a7ec56d1
commit
5c197471c6
@ -109,10 +109,10 @@ class FunctionsTestCase(SupyTestCase):
|
||||
# Test positional args
|
||||
self.assertEqual('\x0300foo\x03', ircutils.mircColor(s, 'white'))
|
||||
self.assertEqual('\x031,02foo\x03',ircutils.mircColor(s,'black','blue'))
|
||||
self.assertEqual('\x03,03foo\x03', ircutils.mircColor(s, None, 'green'))
|
||||
self.assertEqual('\x0300,03foo\x03', ircutils.mircColor(s, None, 'green'))
|
||||
# Test keyword args
|
||||
self.assertEqual('\x0304foo\x03', ircutils.mircColor(s, fg='red'))
|
||||
self.assertEqual('\x03,05foo\x03', ircutils.mircColor(s, bg='brown'))
|
||||
self.assertEqual('\x0300,05foo\x03', ircutils.mircColor(s, bg='brown'))
|
||||
self.assertEqual('\x036,07foo\x03',
|
||||
ircutils.mircColor(s, bg='orange', fg='purple'))
|
||||
|
||||
|
@ -136,11 +136,11 @@ class GenTest(SupyTestCase):
|
||||
|
||||
def testSorted(self):
|
||||
L = ['a', 'c', 'b']
|
||||
self.assertEqual(utils.sorted(L), ['a', 'b', 'c'])
|
||||
self.assertEqual(sorted(L), ['a', 'b', 'c'])
|
||||
self.assertEqual(L, ['a', 'c', 'b'])
|
||||
def mycmp(x, y):
|
||||
return -cmp(x, y)
|
||||
self.assertEqual(utils.sorted(L, mycmp), ['c', 'b', 'a'])
|
||||
self.assertEqual(sorted(L, mycmp), ['c', 'b', 'a'])
|
||||
|
||||
def testTimeElapsed(self):
|
||||
self.assertRaises(ValueError, utils.timeElapsed, 0,
|
||||
|
Loading…
Reference in New Issue
Block a user