changeset 195:e3ab8aca2b08

Make filesupport.py more PEP8 conformant. Rename method checkFileContents to check_file_contents. Update the callers.
author Bernhard Herzog <bh@intevation.de>
date Thu, 31 Jul 2008 10:36:17 +0000
parents 86360f3d5611
children 86ea689eda5f
files test/filesupport.py test/test_builder.py test/test_run.py test/test_util.py
diffstat 4 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/filesupport.py	Thu Jul 31 10:17:56 2008 +0000
+++ b/test/filesupport.py	Thu Jul 31 10:36:17 2008 +0000
@@ -115,6 +115,6 @@
                 writefile(os.path.join(directory, name), contents, permissions)
         return directory
 
-    def checkFileContents(self, filename, contents):
+    def check_file_contents(self, filename, contents):
         """check the contents of a file"""
         self.assertEquals(open(filename).read(), contents)
--- a/test/test_builder.py	Thu Jul 31 10:17:56 2008 +0000
+++ b/test/test_builder.py	Thu Jul 31 10:36:17 2008 +0000
@@ -38,7 +38,7 @@
                              self.command_line_file]
 
     def check_command_line(self, args):
-        self.checkFileContents(self.command_line_file, repr(args))
+        self.check_file_contents(self.command_line_file, repr(args))
 
 
 class TestPBuilder(PBuilderTests):
@@ -85,11 +85,11 @@
             "OTHERMIRROR=\"deb file://%(basedir)s/extra-pkg ./\"\n"
             "BINDMOUNTS=\"%(basedir)s/extra-pkg\"\n"
             "PKGNAME_LOGFILE=yes\n" % locals())
-        self.checkFileContents(pbuilderrc, pbuilderrc_contents)
+        self.check_file_contents(pbuilderrc, pbuilderrc_contents)
 
         # The Packages file is empty for now.
-        self.checkFileContents(os.path.join(basedir, "extra-pkg", "Packages"),
-                               "")
+        self.check_file_contents(os.path.join(basedir, "extra-pkg", "Packages"),
+                                 "")
         # check the text written to stdout.  This test is a little too
         # strict because it checks the exact output.
         self.assertEquals(captured_stdout.getvalue(),
--- a/test/test_run.py	Thu Jul 31 10:17:56 2008 +0000
+++ b/test/test_run.py	Thu Jul 31 10:36:17 2008 +0000
@@ -71,7 +71,7 @@
         logfilename = self.temp_file_name("logfile")
         call([sys.executable, "-c", "print \"I'm a lumber jack and I'm OK\""],
              logfile=logfilename)
-        self.checkFileContents(logfilename, "I'm a lumber jack and I'm OK\n")
+        self.check_file_contents(logfilename, "I'm a lumber jack and I'm OK\n")
 
 
 class TestCaptureOutput(unittest.TestCase):
--- a/test/test_util.py	Thu Jul 31 10:17:56 2008 +0000
+++ b/test/test_util.py	Thu Jul 31 10:36:17 2008 +0000
@@ -21,7 +21,7 @@
         filename = self.create_temp_file("orig", orig_contents)
         changed = replace_in_file(filename, pattern, replacement)
         self.assertEquals(changed, orig_contents != expected_contents)
-        self.checkFileContents(filename, expected_contents)
+        self.check_file_contents(filename, expected_contents)
 
     def test_version_replacement(self):
         template = ("project foo version 1.0-svn%(rev)d"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)