summaryrefslogtreecommitdiff
path: root/tests/test_jid.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-11-14 09:15:43 -0800
committerLance Stout <lancestout@gmail.com>2011-11-14 09:15:43 -0800
commit43c4d23896437dbab9f6cfbe80e885394b84b638 (patch)
treecb24adba676eff655cd3ab9ebbcb74fcae566915 /tests/test_jid.py
parent9f9e8db8144204b64d099437c9cdcdd9944514bc (diff)
downloadslixmpp-43c4d23896437dbab9f6cfbe80e885394b84b638.tar.gz
slixmpp-43c4d23896437dbab9f6cfbe80e885394b84b638.tar.bz2
slixmpp-43c4d23896437dbab9f6cfbe80e885394b84b638.tar.xz
slixmpp-43c4d23896437dbab9f6cfbe80e885394b84b638.zip
Explicitly test for inequality in JIDs.
Fixes issue #113
Diffstat (limited to 'tests/test_jid.py')
-rw-r--r--tests/test_jid.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_jid.py b/tests/test_jid.py
index 99402999..ef1145d3 100644
--- a/tests/test_jid.py
+++ b/tests/test_jid.py
@@ -124,5 +124,18 @@ class TestJIDClass(SleekTest):
'component.someserver',
'component.someserver')
+ def testJIDEquality(self):
+ """Test that JIDs with the same content are equal."""
+ jid1 = JID('user@domain/resource')
+ jid2 = JID('user@domain/resource')
+ self.assertTrue(jid1 == jid2, "Same JIDs are not considered equal")
+ self.assertFalse(jid1 != jid2, "Same JIDs are considered not equal")
+
+ def testJIDInequality(self):
+ jid1 = JID('user@domain/resource')
+ jid2 = JID('otheruser@domain/resource')
+ self.assertFalse(jid1 == jid2, "Same JIDs are not considered equal")
+ self.assertTrue(jid1 != jid2, "Same JIDs are considered not equal")
+
suite = unittest.TestLoader().loadTestsFromTestCase(TestJIDClass)