コード例 #1
0
ファイル: test_athena.py プロジェクト: calston/tums
 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)
コード例 #2
0
ファイル: test_athena.py プロジェクト: calston/tums
 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))
コード例 #3
0
ファイル: test_athena.py プロジェクト: calston/tums
 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'))