# Path: pyxmpp/jid.py
# def are_domains_equal(a,b):
#     def __new__(cls,node_or_jid=None,domain=None,resource=None,check=True):
#     def __setattr__(self,name,value):
#     def __from_unicode(self,s,check=True):
#     def __set_node(self,s):
#     def __set_domain(self,s):
#     def __set_resource(self,s):
#     def __str__(self):
#     def __unicode__(self):
#     def __repr__(self):
#     def as_utf8(self):
#     def as_string(self):
#     def as_unicode(self):
#     def bare(self):
#     def __eq__(self,other):
#     def __ne__(self,other):
#     def __cmp__(self,other):
#     def __hash__(self):
# class JID(object):
# 
# Path: pyxmpp/xmppstringprep.py
# class LookupFunction:
# class LookupTable:
# class Profile:
#     def __init__(self,function):
#     def __init__(self,singles,ranges):
#     def lookup(self,c):
# def b1_mapping(uc):
# def nfkc(data):
#     def __init__(self,unassigned,mapping,normalization,prohibited,bidi=1):
#     def prepare(self,data):
#     def prepare_query(self,s):
#     def map(self,s):
#     def prohibit(self,s):
#     def check_unassigned(self,s):
#     def check_bidi(self,s):
# def set_stringprep_cache_size(size):
# A_1=LookupFunction(stringprep.in_table_a1)
# B_1=LookupFunction(b1_mapping)
# B_2=LookupFunction(stringprep.map_table_b2)
# B_3=LookupFunction(stringprep.map_table_b3)
# C_1_1=LookupFunction(stringprep.in_table_c11)
# C_1_2=LookupFunction(stringprep.in_table_c12)
# C_2_1=LookupFunction(stringprep.in_table_c21)
# C_2_2=LookupFunction(stringprep.in_table_c22)
# C_3=LookupFunction(stringprep.in_table_c3)
# C_4=LookupFunction(stringprep.in_table_c4)
# C_5=LookupFunction(stringprep.in_table_c5)
# C_6=LookupFunction(stringprep.in_table_c6)
# C_7=LookupFunction(stringprep.in_table_c7)
# C_8=LookupFunction(stringprep.in_table_c8)
# C_9=LookupFunction(stringprep.in_table_c9)
# D_1=LookupFunction(stringprep.in_table_d1)
# D_2=LookupFunction(stringprep.in_table_d2)


import unittest
        import weakref
from pyxmpp.jid import JID,JIDError
from pyxmpp import xmppstringprep
            j=JID(jid)
            jtuple=(j.node,j.domain,j.resource)
            self.failUnlessEqual(jtuple,tuple)
    def test_jid_from_tuple(self):
        for (node,domain,resource),jid in valid_tuples:
            j=JID(node,domain,resource)
            self.failUnlessEqual(unicode(j),jid)
    def test_invalid_jids(self):
        for jid in invalid_jids:
            try:
                j=JID(jid)
            except JIDError,e:
                return
            except Exception,e:
                raise
            self.fail("Invalid JID passed: %r -> %r" % (jid,j))
    def test_comparision(self):
        for e in comparisions_true:
            result=eval(e)
            self.failUnless(result,'Expression %r gave: %r' % (e,result))
        for e in comparisions_false:
            result=eval(e)
            self.failIf(result,'Expression %r gave: %r' % (e,result))

class TestUncachedJID(TestJID):
    def setUp(self):
        JID.cache=weakref.WeakValueDictionary()
        self.saved_stringprep_cache_size=xmppstringprep.stringprep_cache_size
        xmppstringprep.set_stringprep_cache_size(0)
    def tearDown(self):

# Path: pyxmpp/jid.py
# def are_domains_equal(a,b):
#     def __new__(cls,node_or_jid=None,domain=None,resource=None,check=True):
#     def __setattr__(self,name,value):
#     def __from_unicode(self,s,check=True):
#     def __set_node(self,s):
#     def __set_domain(self,s):
#     def __set_resource(self,s):
#     def __str__(self):
#     def __unicode__(self):
#     def __repr__(self):
#     def as_utf8(self):
#     def as_string(self):
#     def as_unicode(self):
#     def bare(self):
#     def __eq__(self,other):
#     def __ne__(self,other):
#     def __cmp__(self,other):
#     def __hash__(self):
# class JID(object):
# 
# Path: pyxmpp/xmppstringprep.py
# class LookupFunction:
# class LookupTable:
# class Profile:
#     def __init__(self,function):
#     def __init__(self,singles,ranges):
#     def lookup(self,c):
# def b1_mapping(uc):
# def nfkc(data):
#     def __init__(self,unassigned,mapping,normalization,prohibited,bidi=1):
#     def prepare(self,data):
#     def prepare_query(self,s):
#     def map(self,s):
#     def prohibit(self,s):
#     def check_unassigned(self,s):
#     def check_bidi(self,s):
# def set_stringprep_cache_size(size):
# A_1=LookupFunction(stringprep.in_table_a1)
# B_1=LookupFunction(b1_mapping)
# B_2=LookupFunction(stringprep.map_table_b2)
# B_3=LookupFunction(stringprep.map_table_b3)
# C_1_1=LookupFunction(stringprep.in_table_c11)
# C_1_2=LookupFunction(stringprep.in_table_c12)
# C_2_1=LookupFunction(stringprep.in_table_c21)
# C_2_2=LookupFunction(stringprep.in_table_c22)
# C_3=LookupFunction(stringprep.in_table_c3)
# C_4=LookupFunction(stringprep.in_table_c4)
# C_5=LookupFunction(stringprep.in_table_c5)
# C_6=LookupFunction(stringprep.in_table_c6)
# C_7=LookupFunction(stringprep.in_table_c7)
# C_8=LookupFunction(stringprep.in_table_c8)
# C_9=LookupFunction(stringprep.in_table_c9)
# D_1=LookupFunction(stringprep.in_table_d1)
# D_2=LookupFunction(stringprep.in_table_d2)


# Path: tests/jid.py
import unittest
        import weakref
from pyxmpp.jid import JID,JIDError
from pyxmpp import xmppstringprep

            j=JID(jid)
            jtuple=(j.node,j.domain,j.resource)
            self.failUnlessEqual(jtuple,tuple)
    def test_jid_from_tuple(self):
        for (node,domain,resource),jid in valid_tuples:
            j=JID(node,domain,resource)
            self.failUnlessEqual(unicode(j),jid)
    def test_invalid_jids(self):
        for jid in invalid_jids:
            try:
                j=JID(jid)
            except JIDError,e:
                return
            except Exception,e:
                raise
            self.fail("Invalid JID passed: %r -> %r" % (jid,j))
    def test_comparision(self):
        for e in comparisions_true:
            result=eval(e)
            self.failUnless(result,'Expression %r gave: %r' % (e,result))
        for e in comparisions_false:
            result=eval(e)
            self.failIf(result,'Expression %r gave: %r' % (e,result))

class TestUncachedJID(TestJID):
    def setUp(self):
        JID.cache=weakref.WeakValueDictionary()
        self.saved_stringprep_cache_size=xmppstringprep.stringprep_cache_size
        xmppstringprep.set_stringprep_cache_size(0)
    def tearDown(self):

        xmppstringprep.set_stringprep_cache_size(self.saved_stringprep_cache_size)