Rev 5533: s/blank_output/null_output/ in file:///home/vila/src/bzr/bugs/662509-ignore-empty/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Mon Nov 8 09:58:04 GMT 2010
At file:///home/vila/src/bzr/bugs/662509-ignore-empty/
------------------------------------------------------------
revno: 5533
revision-id: v.ladeuil+lp at free.fr-20101108095804-uk34qhoyr7tfw4ay
parent: v.ladeuil+lp at free.fr-20101108094130-motjiev9rqw1th8u
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 662509-ignore-empty
timestamp: Mon 2010-11-08 10:58:04 +0100
message:
s/blank_output/null_output/
-------------- next part --------------
=== modified file 'bzrlib/cmd_test_script.py'
--- a/bzrlib/cmd_test_script.py 2010-11-05 20:54:32 +0000
+++ b/bzrlib/cmd_test_script.py 2010-11-08 09:58:04 +0000
@@ -16,7 +16,7 @@
"""Front-end command for shell-like test scripts.
-See developers/testing.html for more explanations.
+See doc/developers/testing.txt for more explanations.
This module should be importable even if testtools aren't available.
"""
=== modified file 'bzrlib/tests/script.py'
--- a/bzrlib/tests/script.py 2010-11-08 09:41:30 +0000
+++ b/bzrlib/tests/script.py 2010-11-08 09:58:04 +0000
@@ -196,8 +196,7 @@
self.output_checker = doctest.OutputChecker()
self.check_options = doctest.ELLIPSIS
- def run_script(self, test_case, text,
- blank_output_matches_anything=False):
+ def run_script(self, test_case, text, null_output_matches_anything=False):
"""Run a shell-like script as a test.
:param test_case: A TestCase instance that should provide the fail(),
@@ -206,11 +205,11 @@
:param text: A shell-like script (see _script_to_commands for syntax).
- :param blank_output_matches_anything: For commands with no specified
+ :param null_output_matches_anything: For commands with no specified
output, ignore any output that does happen, including output on
standard error.
"""
- self.blank_output_matches_anything = blank_output_matches_anything
+ self.null_output_matches_anything = null_output_matches_anything
for cmd, input, output, error in _script_to_commands(text):
self.run_command(test_case, cmd, input, output, error)
@@ -252,11 +251,11 @@
test_case.fail('expected output: %r, but found nothing'
% (expected,))
- blank_output_matches_anything = getattr(self,
- 'blank_output_matches_anything', False)
- if blank_output_matches_anything and expected is None:
+ null_output_matches_anything = getattr(
+ self, 'null_output_matches_anything', False)
+ if null_output_matches_anything and expected is None:
return
-
+
expected = expected or ''
matching = self.output_checker.check_output(
expected, actual, self.check_options)
@@ -485,9 +484,9 @@
super(TestCaseWithMemoryTransportAndScript, self).setUp()
self.script_runner = ScriptRunner()
- def run_script(self, script, blank_output_matches_anything=False):
+ def run_script(self, script, null_output_matches_anything=False):
return self.script_runner.run_script(self, script,
- blank_output_matches_anything=blank_output_matches_anything)
+ null_output_matches_anything=null_output_matches_anything)
def run_command(self, cmd, input, output, error):
return self.script_runner.run_command(self, cmd, input, output, error)
@@ -515,16 +514,16 @@
super(TestCaseWithTransportAndScript, self).setUp()
self.script_runner = ScriptRunner()
- def run_script(self, script, blank_output_matches_anything=False):
+ def run_script(self, script, null_output_matches_anything=False):
return self.script_runner.run_script(self, script,
- blank_output_matches_anything=blank_output_matches_anything)
+ null_output_matches_anything=null_output_matches_anything)
def run_command(self, cmd, input, output, error):
return self.script_runner.run_command(self, cmd, input, output, error)
-def run_script(test_case, script_string, blank_output_matches_anything=False):
+def run_script(test_case, script_string, null_output_matches_anything=False):
"""Run the given script within a testcase"""
return ScriptRunner().run_script(test_case, script_string,
- blank_output_matches_anything=blank_output_matches_anything)
+ null_output_matches_anything=null_output_matches_anything)
=== modified file 'bzrlib/tests/test_script.py'
--- a/bzrlib/tests/test_script.py 2010-11-08 09:41:30 +0000
+++ b/bzrlib/tests/test_script.py 2010-11-08 09:58:04 +0000
@@ -186,13 +186,13 @@
$ echo foo
""")
- def test_blank_output_matches_option(self):
- """If you want blank output to be a wild card, you can pass
- blank_output_matches_anything to run_script"""
+ def test_null_output_matches_option(self):
+ """If you want null output to be a wild card, you can pass
+ null_output_matches_anything to run_script"""
self.run_script(
"""
$ echo foo
- """, blank_output_matches_anything=True)
+ """, null_output_matches_anything=True)
def test_ellipsis_everything(self):
"""A simple ellipsis matches everything."""
=== modified file 'doc/developers/testing.txt'
--- a/doc/developers/testing.txt 2010-11-08 09:41:30 +0000
+++ b/doc/developers/testing.txt 2010-11-08 09:58:04 +0000
@@ -474,15 +474,15 @@
To avoid having to specify "-q" for all commands whose output is
irrelevant, the run_script() method may be passed the keyword argument
-``blank_output_matches_anything=True``. For example::
+``null_output_matches_anything=True``. For example::
- def test_ignoring_blank_output(self):
+ def test_ignoring_null_output(self):
self.run_script("""
$ bzr init
$ bzr ci -m 'first revision' --unchanged
$ bzr log --line
1: ...
- """, blank_output_matches_anything=True)
+ """, null_output_matches_anything=True)
Import tariff tests
=== modified file 'doc/en/release-notes/bzr-2.3.txt'
--- a/doc/en/release-notes/bzr-2.3.txt 2010-11-08 09:41:30 +0000
+++ b/doc/en/release-notes/bzr-2.3.txt 2010-11-08 09:58:04 +0000
@@ -185,9 +185,10 @@
Instead, use '...' as a wildcard if you don't care about the output.
(Martin Pool, #637830)
-* Add a blank_output_matches_anything keyword argument with default False to
- bzrlib.tests.script.ScriptRunner.run_script to specify if missing
- output does not need to be matched. (Neil Martinsen-Burrell, #662509)
+* Add a null_output_matches_anything keyword argument with default False to
+ bzrlib.tests.script.ScriptRunner.run_script to specify that the command
+ output should not be checked (as opposed to expecting an empty output).
+ (Neil Martinsen-Burrell, #662509)
* ``bzr test-script script`` is a new command that runs a shell-like script
from an the ``script`` file. (Vincent Ladeuil)
More information about the bazaar-commits
mailing list