[Zope3-checkins] CVS: Zope3/src/zope/app/browser/applicationcontrol/tests - test_runtimeinfoview.py:1.7 test_servercontrolview.py:1.6

Stephan Richter srichter@cosmos.phy.tufts.edu
Thu, 31 Jul 2003 17:38:06 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/applicationcontrol/tests
In directory cvs.zope.org:/tmp/cvs-serv12920/browser/applicationcontrol/tests

Modified Files:
	test_runtimeinfoview.py test_servercontrolview.py 
Log Message:
- Added ZODB Control. You can now see the size of the ZODB and pack it the
  usual way, specifying the number of days that should be preserved.

- Cleaned up the crufty ApplicationControl code a bit to the latest 
  practices and cleaned up whitespace stuff.


=== Zope3/src/zope/app/browser/applicationcontrol/tests/test_runtimeinfoview.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/browser/applicationcontrol/tests/test_runtimeinfoview.py:1.6	Wed Apr 30 19:37:48 2003
+++ Zope3/src/zope/app/browser/applicationcontrol/tests/test_runtimeinfoview.py	Thu Jul 31 17:37:31 2003
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2001, 2002, 2003 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -11,27 +11,29 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""Runtime View tests
 
-from unittest import TestCase, main, makeSuite
+$Id$
+"""
+import unittest
+from types import DictType
 
-from zope.app.applicationcontrol.applicationcontrol import \
-  applicationController
-from zope.app.interfaces.applicationcontrol.applicationcontrol import \
-  IApplicationControl
-from zope.app.interfaces.applicationcontrol.runtimeinfo import IRuntimeInfo
+from zope.app.applicationcontrol.applicationcontrol import applicationController
 from zope.app.applicationcontrol.runtimeinfo import RuntimeInfo
-from zope.app.browser.applicationcontrol.runtimeinfo \
-  import RuntimeInfoView
-from zope.component import getService
+from zope.app.browser.applicationcontrol.runtimeinfo import RuntimeInfoView
+from zope.app.interfaces.applicationcontrol import \
+     IApplicationControl, IRuntimeInfo
 from zope.app.services.servicenames import Adapters
-from types import DictType
-from zope.app.services.tests.placefulsetup\
-           import PlacefulSetup
+from zope.app.services.tests.placefulsetup import PlacefulSetup
+from zope.component import getService
 
-class Test(PlacefulSetup, TestCase):
+class Test(PlacefulSetup, unittest.TestCase):
 
     def _TestView__newView(self, container):
-        return RuntimeInfoView(container, None)
+        view = RuntimeInfoView()
+        view.context = container
+        view.request = None
+        return view
 
     def test_RuntimeInfoView(self):
         getService(None,Adapters).provideAdapter(
@@ -67,8 +69,11 @@
 
         self.failUnless(test_format["ZopeVersion"] == "N/A")
 
+
 def test_suite():
-    return makeSuite(Test)
+    return unittest.TestSuite((
+        unittest.makeSuite(Test),
+        ))
 
-if __name__=='__main__':
-    main(defaultTest='test_suite')
+if __name__ == '__main__':
+    unittest.main()


=== Zope3/src/zope/app/browser/applicationcontrol/tests/test_servercontrolview.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/applicationcontrol/tests/test_servercontrolview.py:1.5	Wed Apr 30 19:37:48 2003
+++ Zope3/src/zope/app/browser/applicationcontrol/tests/test_servercontrolview.py	Thu Jul 31 17:37:31 2003
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# Copyright (c) 2001, 2002, 2003 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -11,25 +11,27 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""Server Control View Tests
 
-from unittest import TestCase, main, makeSuite
+$Id$
+"""
+import unittest
 
-from zope.app.applicationcontrol.applicationcontrol import \
-  applicationController
-from zope.app.interfaces.applicationcontrol.servercontrol import \
-  IServerControl
+from zope.app.applicationcontrol.applicationcontrol import applicationController
+from zope.app.applicationcontrol.servercontrol import ServerControl
 from zope.app.browser.applicationcontrol.servercontrol import ServerControlView
-from zope.app.applicationcontrol.servercontrol import \
-  ServerControl
-from zope.component import getService
+from zope.app.interfaces.applicationcontrol import IServerControl
 from zope.app.services.servicenames import Utilities
-from zope.app.services.tests.placefulsetup\
-           import PlacefulSetup
+from zope.app.services.tests.placefulsetup import PlacefulSetup
+from zope.component import getService
 
-class Test(PlacefulSetup, TestCase):
+class Test(PlacefulSetup, unittest.TestCase):
 
     def _TestView__newView(self, container, request):
-        return ServerControlView(container, request)
+        view = ServerControlView()
+        view.context = container
+        view.request = request
+        return view
 
     def test_ServerControlView(self):
         getService(None,Utilities).provideUtility(
@@ -47,8 +49,11 @@
             )
         test_serverctrl.action()
 
+
 def test_suite():
-    return makeSuite(Test)
+    return unittest.TestSuite((
+        unittest.makeSuite(Test),
+        ))
 
-if __name__=='__main__':
-    main(defaultTest='test_suite')
+if __name__ == '__main__':
+    unittest.main()