# HG changeset patch # User Bernhard Herzog # Date 1217500577 0 # Node ID e3ab8aca2b0846afea509cc4ea16325339ac8855 # Parent 86360f3d5611fbee8a342905eacd22edc404ea74 Make filesupport.py more PEP8 conformant. Rename method checkFileContents to check_file_contents. Update the callers. diff -r 86360f3d5611 -r e3ab8aca2b08 test/filesupport.py --- 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) diff -r 86360f3d5611 -r e3ab8aca2b08 test/test_builder.py --- 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(), diff -r 86360f3d5611 -r e3ab8aca2b08 test/test_run.py --- 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): diff -r 86360f3d5611 -r e3ab8aca2b08 test/test_util.py --- 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"