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

Module test_objectify

source code

Tests specific to the lxml.objectify API
Classes
  ObjectifyTestCase
Test cases for lxml.objectify
Functions
 
test_suite() source code
Variables
  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': '/objectify/py...
  objectclass2xsitype = {<type 'lxml.objectify.IntElement'>: ('i...
  xsitype2objclass = {'ENTITY': <type 'lxml.objectify.StringElem...
  objectclass2pytype = {<type 'lxml.objectify.IntElement'>: 'int...
  pytype2objclass = {'bool': <type 'lxml.objectify.BoolElement'>...
  xml_str = '<obj:root xmlns:obj="objectified" xmlns:other="othe...
  v = 'NMTOKEN'
Variables Details

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.IntElement'>: ('int',
                                      'short',
                                      'byte',
                                      'unsignedShort',
                                      'unsignedByte'),
 <type 'lxml.objectify.LongElement'>: ('integer',
                                       'nonPositiveInteger',
                                       'negativeInteger',
...

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.IntElement'>: 'int',
 <type 'lxml.objectify.LongElement'>: 'long',
 <type 'lxml.objectify.FloatElement'>: 'float',
 <type 'lxml.objectify.StringElement'>: 'str',
 <type 'lxml.objectify.BoolElement'>: 'bool'}

pytype2objclass

Value:
{'bool': <type 'lxml.objectify.BoolElement'>,
 'float': <type 'lxml.objectify.FloatElement'>,
 'int': <type 'lxml.objectify.IntElement'>,
 'long': <type 'lxml.objectify.LongElement'>,
 '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>3</c2>
  </obj:c1>
...