Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
Marshall.tests.test_predicate.XMLNSPredicateTest Class Reference
Inheritance diagram for Marshall.tests.test_predicate.XMLNSPredicateTest:
Inheritance graph
[legend]
Collaboration diagram for Marshall.tests.test_predicate.XMLNSPredicateTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_xmlns_element
def test_xmlns_element
def test_xmlns_element_ns
def test_xmlns_element_ns_att
def test_xmlns_element_ns_att_ns
def afterSetUp
def get
def reverse

Public Attributes

 qi
 tool

Detailed Description

Definition at line 164 of file test_predicate.py.


Member Function Documentation

Definition at line 41 of file test_predicate.py.

00041 
00042     def afterSetUp(self):
00043         super(PredicateTest, self).afterSetUp()
00044         self.loginPortalOwner()
00045         self.qi = self.portal.portal_quickinstaller
00046         self.qi.installProduct('Marshall')
00047         self.tool = getToolByName(self.portal, tool_id)

Here is the call graph for this function:

def Marshall.tests.test_predicate.PredicateTest.get (   self,
  obj,
  kw 
) [inherited]

Definition at line 48 of file test_predicate.py.

00048 
00049     def get(self, obj, **kw):
00050         return self.tool.getMarshallersFor(obj, **kw)

Here is the caller graph for this function:

Definition at line 51 of file test_predicate.py.

00051 
00052     def reverse(self):
00053         ids = self.tool.objectIds()
00054         for pos, id in enumerate(ids):
00055             self.tool.moveObjectToPosition(id, len(ids) - pos)

Here is the caller graph for this function:

Definition at line 166 of file test_predicate.py.

00166 
00167     def test_xmlns_element(self):
00168         p = add_predicate(
00169             self.tool,
00170             id='xmlns_attr',
00171             title='xmlns',
00172             predicate='xmlns_attr',
00173             expression='',
00174             component_name='primary_field')
00175         p.edit(element_name='test', value='FooBar')
00176         data = """<?xml version="1.0" encoding="UTF-8"?>
00177         <test>
00178            FooBar
00179         </test>
00180         """
00181         bad_data = """<?xml version="1.0" encoding="UTF-8"?>
00182         <test>
00183            FooBaz
00184         </test>
00185         """
00186         self.assertEquals(self.get(None, data=data), ('primary_field',))
00187         self.assertEquals(self.get(None, data=bad_data), ())
00188         self.assertEquals(self.get(None, data=''), ())

Here is the caller graph for this function:

Definition at line 189 of file test_predicate.py.

00189 
00190     def test_xmlns_element(self):
00191         p = add_predicate(
00192             self.tool,
00193             id='xmlns_attr',
00194             title='xmlns',
00195             predicate='xmlns_attr',
00196             expression='',
00197             component_name='primary_field')
00198         p.edit(element_name='test', value=None)
00199         data = """<?xml version="1.0" encoding="UTF-8"?>
00200         <test>
00201            Doesn't Matter
00202         </test>
00203         """
00204         self.assertEquals(self.get(None, data=data), ('primary_field',))

Definition at line 205 of file test_predicate.py.

00205 
00206     def test_xmlns_element_ns(self):
00207         p = add_predicate(
00208             self.tool,
00209             id='xmlns_attr',
00210             title='xmlns',
00211             predicate='xmlns_attr',
00212             expression='',
00213             component_name='primary_field')
00214         p.edit(element_ns='http://foo.com/bar', element_name='test',
00215                value='FooBar')
00216         data = """<?xml version="1.0" encoding="UTF-8"?>
00217         <t:test xmlns:t="http://foo.com/bar">
00218                 FooBar
00219         </t:test>
00220         """
00221         self.assertEquals(self.get(None, data=data), ('primary_field',))

Definition at line 222 of file test_predicate.py.

00222 
00223     def test_xmlns_element_ns_att(self):
00224         p = add_predicate(
00225             self.tool,
00226             id='xmlns_attr',
00227             title='xmlns',
00228             predicate='xmlns_attr',
00229             expression='',
00230             component_name='primary_field')
00231         p.edit(element_ns='http://foo.com/bar', element_name='test',
00232                attr_name='wot', value='FooBar')
00233         data = """<?xml version="1.0" encoding="UTF-8"?>
00234         <t:test xmlns:t="http://foo.com/bar"
00235            wot="FooBar" />
00236         """
00237         self.assertEquals(self.get(None, data=data), ('primary_field',))

Definition at line 238 of file test_predicate.py.

00238 
00239     def test_xmlns_element_ns_att_ns(self):
00240         p = add_predicate(
00241             self.tool,
00242             id='xmlns_attr',
00243             title='xmlns',
00244             predicate='xmlns_attr',
00245             expression='',
00246             component_name='primary_field')
00247         p.edit(element_ns='http://foo.com/bar', element_name='test',
00248                attr_ns='http://foo.com/bar', attr_name='wot',
00249                value='FooBar')
00250         data = """<?xml version="1.0" encoding="UTF-8"?>
00251         <t:test xmlns:t="http://foo.com/bar"
00252            t:wot="FooBar" />
00253         """
00254         self.assertEquals(self.get(None, data=data), ('primary_field',))
00255 


Member Data Documentation

Definition at line 44 of file test_predicate.py.

Definition at line 46 of file test_predicate.py.


The documentation for this class was generated from the following file: