Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
kss.core.tests.test_kssview_core.FTestKSSViewCoreCommandSet Class Reference
Inheritance diagram for kss.core.tests.test_kssview_core.FTestKSSViewCoreCommandSet:
Inheritance graph
[legend]
Collaboration diagram for kss.core.tests.test_kssview_core.FTestKSSViewCoreCommandSet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def assertXMLEquals
def assertCommandsEqual
def test_empty
def test_replaceInnerHTML
def test_setCommandSet
def loadCoreConfig
def createView
def setDebugRequest

Public Attributes

 view

Static Public Attributes

 layer = KSSLayer

Private Member Functions

def _wrapped_commands

Detailed Description

Definition at line 97 of file test_kssview_core.py.


Member Function Documentation

Definition at line 100 of file test_kssview_core.py.

00100 
00101     def _wrapped_commands(self, inline):
00102         header = textwrap.dedent(u'''\
00103                 <?xml version="1.0" ?>
00104                 <kukit xmlns="http://www.kukit.org/commands/1.1">
00105                 <commands>
00106                 ''')
00107         footer = textwrap.dedent('''\
00108                 </commands>
00109                 </kukit>
00110                 ''')
00111         return header + inline + footer

Here is the caller graph for this function:

Definition at line 115 of file test_kssview_core.py.

00115 
00116     def assertCommandsEqual(self, a, b):
00117         self.assertXMLEquals(a, self._wrapped_commands(b))

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file test_kssview_core.py.

00112 
00113     def assertXMLEquals(self, a, b):
00114         self.assertEqual(a, b)

Here is the caller graph for this function:

Definition at line 108 of file base.py.

00108 
00109     def createView(self):
00110         "Set up a fake view (with no content)"
00111         self.view = self.folder.restrictedTraverse('testMethod')
00112         return self.view

Here is the caller graph for this function:

def kss.core.tests.base.KSSViewTestCaseMixin.loadCoreConfig (   self,
  kss_core = True 
) [inherited]

Definition at line 102 of file base.py.

00102 
00103     def loadCoreConfig(self, kss_core=True):
00104         warnings.warn(
00105             "KSS tests are now using layers.  Please do not use "
00106             "loadCoreConfig anymore.",
00107             DeprecationWarning)
    

Definition at line 113 of file base.py.

00113 
00114     def setDebugRequest(self):
00115         'commands will be rendered as test friendly data structures'
00116         request = self.folder.REQUEST
00117         interface.directlyProvides(
00118             request,
00119             interface.directlyProvidedBy(request) + IDebugRequest)

Here is the caller graph for this function:

Definition at line 118 of file test_kssview_core.py.

00118 
00119     def test_empty(self):
00120         view = self.createView()
00121         result = view.render()
00122         self.assertEquals(view.request.response.getHeader('content-type'), 'text/xml;charset=utf-8')
00123         self.assertCommandsEqual(result, '')
    

Here is the call graph for this function:

Definition at line 124 of file test_kssview_core.py.

00124 
00125     def test_replaceInnerHTML(self):
00126         view = self.createView()
00127         view.getCommandSet('core').replaceInnerHTML('div.class', 'new content')
00128         result = view.render()
00129         awaited = u'''\
00130 <command selector="div.class" name="replaceInnerHTML"
00131          selectorType="">
00132     <param name="html"><![CDATA[new content]]></param>
00133     <param name="withKssSetup">True</param>
00134 </command>
00135 '''
00136         self.assertCommandsEqual(result, awaited)
        

Here is the call graph for this function:

Definition at line 137 of file test_kssview_core.py.

00137 
00138     def test_setCommandSet(self):
00139         view = self.createView()
00140         cs = view.getCommandSet('core')
00141         cs.replaceInnerHTML('div.class', 'new content')
00142         result = view.render()
00143         awaited = u'''\
00144 <command selector="div.class" name="replaceInnerHTML"
00145          selectorType="">
00146     <param name="html"><![CDATA[new content]]></param>
00147     <param name="withKssSetup">True</param>
00148 </command>
00149 '''
00150         self.assertCommandsEqual(result, awaited)

Here is the call graph for this function:


Member Data Documentation

kss.core.tests.base.KSSViewTestCase.layer = KSSLayer [static, inherited]

Definition at line 121 of file base.py.


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