[Treepkg-commits] r120 - trunk/test
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jul 31 12:36:17 CEST 2008
Author: bh
Date: 2008-07-31 12:36:17 +0200 (Thu, 31 Jul 2008)
New Revision: 120
Modified:
trunk/test/filesupport.py
trunk/test/test_builder.py
trunk/test/test_run.py
trunk/test/test_util.py
Log:
Make filesupport.py more PEP8 conformant. Rename method
checkFileContents to check_file_contents. Update the callers.
Modified: trunk/test/filesupport.py
===================================================================
--- trunk/test/filesupport.py 2008-07-31 10:17:56 UTC (rev 119)
+++ trunk/test/filesupport.py 2008-07-31 10:36:17 UTC (rev 120)
@@ -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)
Modified: trunk/test/test_builder.py
===================================================================
--- trunk/test/test_builder.py 2008-07-31 10:17:56 UTC (rev 119)
+++ trunk/test/test_builder.py 2008-07-31 10:36:17 UTC (rev 120)
@@ -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(),
Modified: trunk/test/test_run.py
===================================================================
--- trunk/test/test_run.py 2008-07-31 10:17:56 UTC (rev 119)
+++ trunk/test/test_run.py 2008-07-31 10:36:17 UTC (rev 120)
@@ -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):
Modified: trunk/test/test_util.py
===================================================================
--- trunk/test/test_util.py 2008-07-31 10:17:56 UTC (rev 119)
+++ trunk/test/test_util.py 2008-07-31 10:36:17 UTC (rev 120)
@@ -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"
More information about the Treepkg-commits
mailing list