Package lxml :: Package tests :: Module test_objectify
[hide private]
[frames] | no frames]

Module test_objectify

source code

Tests specific to the lxml.objectify API
Classes [hide private]
  ObjectifyTestCase
Test cases for lxml.objectify
Functions [hide private]
 
test_suite() source code
Variables [hide private]
  PYTYPE_NAMESPACE = 'http://codespeak.net/lxml/objectify/pytype'
  XML_SCHEMA_NS = 'http://www.w3.org/2001/XMLSchema'
  XML_SCHEMA_INSTANCE_NS = 'http://www.w3.org/2001/XMLSchema-ins...
  XML_SCHEMA_INSTANCE_TYPE_ATTR = '{http://www.w3.org/2001/XMLSc...
  XML_SCHEMA_NIL_ATTR = '{http://www.w3.org/2001/XMLSchema-insta...
  TREE_PYTYPE = 'TREE'
  DEFAULT_NSMAP = {'py': 'http://codespeak.net/lxml/objectify/py...
  objectclass2xsitype = {<type 'lxml.objectify.BoolElement'>: ('...
  xsitype2objclass = {'ENTITY': <type 'lxml.objectify.StringElem...
  objectclass2pytype = {<type 'lxml.objectify.BoolElement'>: 'bo...
  pytype2objclass = {'bool': <type 'lxml.objectify.BoolElement'>...
  xml_str = '<obj:root xmlns:obj="objectified" xmlns:other="othe...
  __package__ = 'lxml.tests'
  v = 'NMTOKEN'
Variables Details [hide private]

XML_SCHEMA_INSTANCE_NS

Value:
'http://www.w3.org/2001/XMLSchema-instance'

XML_SCHEMA_INSTANCE_TYPE_ATTR

Value:
'{http://www.w3.org/2001/XMLSchema-instance}type'

XML_SCHEMA_NIL_ATTR

Value:
'{http://www.w3.org/2001/XMLSchema-instance}nil'

DEFAULT_NSMAP

Value:
{'py': 'http://codespeak.net/lxml/objectify/pytype',
 'xsd': 'http://www.w3.org/2001/XMLSchema',
 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}

objectclass2xsitype

Value:
{<type 'lxml.objectify.BoolElement'>: ('boolean'),
 <type 'lxml.objectify.StringElement'>: ('string',
                                         'normalizedString',
                                         'token',
                                         'language',
                                         'Name',
                                         'NCName',
                                         'ID',
...

xsitype2objclass

Value:
{'ENTITY': <type 'lxml.objectify.StringElement'>,
 'ID': <type 'lxml.objectify.StringElement'>,
 'IDREF': <type 'lxml.objectify.StringElement'>,
 'NCName': <type 'lxml.objectify.StringElement'>,
 'NMTOKEN': <type 'lxml.objectify.StringElement'>,
 'Name': <type 'lxml.objectify.StringElement'>,
 'boolean': <type 'lxml.objectify.BoolElement'>,
 'byte': <type 'lxml.objectify.IntElement'>,
...

objectclass2pytype

Value:
{<type 'lxml.objectify.BoolElement'>: 'bool',
 <type 'lxml.objectify.StringElement'>: 'str',
 <type 'lxml.objectify.FloatElement'>: 'float',
 <type 'lxml.objectify.IntElement'>: 'int'}

pytype2objclass

Value:
{'bool': <type 'lxml.objectify.BoolElement'>,
 'float': <type 'lxml.objectify.FloatElement'>,
 'int': <type 'lxml.objectify.IntElement'>,
 'str': <type 'lxml.objectify.StringElement'>}

xml_str

Value:
'''<obj:root xmlns:obj="objectified" xmlns:other="otherNS">
  <obj:c1 a1="A1" a2="A2" other:a3="A3">
    <obj:c2>0</obj:c2>
    <obj:c2>1</obj:c2>
    <obj:c2>2</obj:c2>
    <other:c2>3</other:c2>
    <c2>4</c2>
  </obj:c1>
...