Exemple #1
0
 def test_lookupNonExistentJavascriptModule(self):
     """
     Test that the parent resource for all JavaScript modules returns the
     correct thing when asked for a module.
     """
     m = athena.JSModules({'name': 'value'})
     self.assertEquals(m.locateChild(None, ('key',)), rend.NotFound)
Exemple #2
0
 def test_renderJavascriptModules(self):
     """
     The parent of the javascript modules is not renderable itself.  Make
     sure it's a 404.
     """
     m = athena.JSModules({})
     self.failUnless(isinstance(m.renderHTTP(None), rend.FourOhFour))
Exemple #3
0
 def test_lookupJavascriptModule(self):
     """
     Test that retrieving a JavaScript module which actually exists returns
     whatever the resourceFactory method produces.
     """
     m = athena.JSModules({'name': 'value'})
     m.resourceFactory = sets.Set
     resource, segments = m.locateChild(None, ('name',))
     self.assertEquals(segments, [])
     self.assertEquals(resource, sets.Set('value'))