[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/tests - testZopePublication.py:1.1.2.22
Jim Fulton
jim@zope.com
Tue, 9 Apr 2002 06:24:50 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/tests
In directory cvs.zope.org:/tmp/cvs-serv1240/Zope/App/ZopePublication/tests
Modified Files:
Tag: Zope-3x-branch
testZopePublication.py
Log Message:
Added new name to the etc namespace, ApplicationController. This is an
object that provides global application control. It is similar to the
Zope2 control panel. It *is not* stored in the object database, so you
can get to it even if your database is toast or your root object is
messed up.
It's handled kind of weirdly, since it's effectively an alternative
application object.
=== Zope3/lib/python/Zope/App/ZopePublication/tests/testZopePublication.py 1.1.2.21 => 1.1.2.22 ===
self.assertEqual(getcontext(ob2), ob)
- def testTraverseNameEtc(self):
+ def testTraverseNameServices(self):
pub = self.klass(self.db)
class C:
def getServiceManager(self):
@@ -312,6 +312,19 @@
ob2 = pub.traverseName(r, ob, 'Services;etc')
self.assertEqual(getobject(ob2), 1)
self.assertEqual(getcontext(ob2), ob)
+
+ def testTraverseNameApplicationControl(self):
+ from Zope.App.OFS.ApplicationControl.ApplicationControl \
+ import ApplicationController
+ pub = self.klass(self.db)
+ r = self._createRequest('/ApplicationController;etc;skin=zmi',pub)
+ ac = pub.traverseName(r, None, 'ApplicationController;etc;skin=zmi')
+ self.assertEqual(ac, ApplicationController)
+ r = self._createRequest('/ApplicationController;etc;skin=zmi',pub)
+ app = r.getPublication().getApplication(r)
+ self.assertEqual(app, ApplicationController)
+ self.failIf(r.getTraversalStack())
+
def test_suite():
t1 = unittest.makeSuite(ZopePublicationTests, 'test')