[Zope-Checkins] SVN: zdaemon/branches/py3/src/zdaemon/tests/testzd Avoid deprecated spellings of assertion methods.

Marius Gedminas cvs-admin at zope.org
Thu Feb 14 11:15:40 UTC 2013


Log message for revision 129393:
  Avoid deprecated spellings of assertion methods.

Changed:
  U   zdaemon/branches/py3/src/zdaemon/tests/testzdoptions.py
  U   zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py

-=-
Modified: zdaemon/branches/py3/src/zdaemon/tests/testzdoptions.py
===================================================================
--- zdaemon/branches/py3/src/zdaemon/tests/testzdoptions.py	2013-02-14 11:15:36 UTC (rev 129392)
+++ zdaemon/branches/py3/src/zdaemon/tests/testzdoptions.py	2013-02-14 11:15:39 UTC (rev 129393)
@@ -204,7 +204,7 @@
         L = []
         options.add("setting", None, "a:", "append=", handler=L.append)
         options.realize(["-a2", "--append", "3"])
-        self.assert_(options.setting is None)
+        self.assertTrue(options.setting is None)
         self.assertEqual(L, ["2", "3"])
 
     def test_handler_with_bad_value(self):
@@ -373,7 +373,7 @@
         options = self.OptionsClass()
         path = os.path.join(self.root, 'will-be-created')
         options.realize(["-z", path])
-        self.assertEquals(path, options.directory)
+        self.assertEqual(path, options.directory)
         socket = os.path.join(path, 'socket')
         options = self.OptionsClass()
         options.realize(["-s", socket])

Modified: zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py
===================================================================
--- zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py	2013-02-14 11:15:36 UTC (rev 129392)
+++ zdaemon/branches/py3/src/zdaemon/tests/testzdrun.py	2013-02-14 11:15:39 UTC (rev 129393)
@@ -152,7 +152,7 @@
         try:
             options.realize(["-h"], doc=zdrun.__doc__)
         except SystemExit as err:
-            self.failIf(err.code)
+            self.assertEqual(err.code, 0)
         else:
             self.fail("SystemExit expected")
         self.expect = zdrun.__doc__
@@ -231,8 +231,8 @@
                  else:
                      is_started = True
                      break
-            self.assert_(is_started,
-                         "spawned process failed to start in a minute")
+            self.assertTrue(is_started,
+                            "spawned process failed to start in a minute")
             # Kill it, and wait a little to ensure it's dead.
             os.kill(zdctlpid, signal.SIGINT)
             time.sleep(0.25)
@@ -282,8 +282,8 @@
             for i in range(5):
                 if not os.path.exists(path):
                     time.sleep(0.1)
-            self.assert_(os.path.exists(path))
-            self.assert_(not os.access(path, os.W_OK))
+            self.assertTrue(os.path.exists(path))
+            self.assertTrue(not os.access(path, os.W_OK))
         finally:
             if os.path.exists(path):
                 os.remove(path)
@@ -324,7 +324,7 @@
     def testCtlRunDirectoryCreation(self):
         path = os.path.join(self.root, 'rundir')
         self.run_ctl(['-z', path, '-p', self.cmd])
-        self.assert_(os.path.exists(path))
+        self.assertTrue(os.path.exists(path))
 
     def testCtlRunDirectoryCreationFromConfigFile(self):
         path = os.path.join(self.root, 'rundir')
@@ -333,7 +333,7 @@
         config = self.writeConfig(
             '<runner>\n%s\n</runner>' % '\n'.join(options))
         self.run_ctl(['-C', config])
-        self.assert_(os.path.exists(path))
+        self.assertTrue(os.path.exists(path))
 
     def testCtlRunDirectoryCreationOnlyOne(self):
         path = os.path.join(self.root, 'rundir', 'not-created')
@@ -347,13 +347,13 @@
     def testCtlSocketDirectoryCreation(self):
         path = os.path.join(self.root, 'rundir', 'sock')
         self.run_ctl(['-s', path, '-p', self.cmd])
-        self.assert_(os.path.exists(os.path.dirname(path)))
+        self.assertTrue(os.path.exists(os.path.dirname(path)))
 
     def testCtlSocketDirectoryCreationRelativePath(self):
         path = os.path.join('rundir', 'sock')
         self.run_ctl(['-s', path, '-p', self.cmd])
-        self.assert_(os.path.exists(os.path.dirname(os.path.join(os.getcwd(),
-                                                                 path))))
+        self.assertTrue(os.path.exists(os.path.dirname(os.path.join(os.getcwd(),
+                                                                    path))))
 
     def testCtlSocketDirectoryCreationOnlyOne(self):
         path = os.path.join(self.root, 'rundir', 'not-created', 'sock')
@@ -371,7 +371,7 @@
         config = self.writeConfig(
             '<runner>\n%s\n</runner>' % '\n'.join(options))
         self.run_ctl(['-C', config])
-        self.assert_(os.path.exists(path))
+        self.assertTrue(os.path.exists(path))
 
     def testCtlSocketDirectoryCreationFromConfigFileRelativePath(self):
         path = 'rel-rundir'
@@ -380,7 +380,7 @@
         config = self.writeConfig(
             '<runner>\n%s\n</runner>' % '\n'.join(options))
         self.run_ctl(['-C', config])
-        self.assert_(os.path.exists(os.path.join(os.getcwd(), path)))
+        self.assertTrue(os.path.exists(os.path.join(os.getcwd(), path)))
 
     def writeConfig(self, config):
         config_file = os.path.join(self.root, 'config')



More information about the Zope-Checkins mailing list