mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Stupid __eq__ not being used in __ne__...
This commit is contained in:
parent
ce0002f454
commit
8eed3f0982
@ -326,6 +326,9 @@ class IrcString(str):
|
||||
except:
|
||||
return False
|
||||
|
||||
def __ne__(self, s):
|
||||
return not self == s
|
||||
|
||||
def __hash__(self):
|
||||
return hash(self.lowered)
|
||||
|
||||
|
@ -212,7 +212,7 @@ class IrcSetTestCase(unittest.TestCase):
|
||||
self.failIf('FOo' in s)
|
||||
|
||||
class IrcStringTestCase(unittest.TestCase):
|
||||
def test(self):
|
||||
def testEquality(self):
|
||||
self.assertEqual('#foo', ircutils.IrcString('#foo'))
|
||||
self.assertEqual('#foo', ircutils.IrcString('#FOO'))
|
||||
self.assertEqual('#FOO', ircutils.IrcString('#foo'))
|
||||
@ -220,6 +220,12 @@ class IrcStringTestCase(unittest.TestCase):
|
||||
self.assertEqual(hash(ircutils.IrcString('#FOO')),
|
||||
hash(ircutils.IrcString('#foo')))
|
||||
|
||||
def testInequality(self):
|
||||
s1 = 'supybot'
|
||||
s2 = ircutils.IrcString('Supybot')
|
||||
self.failUnless(s1 == s2)
|
||||
self.failIf(s1 != s2)
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user