testtools-dev team mailing list archive
-
testtools-dev team
-
Mailing list archive
-
Message #00766
[Merge] lp:~jml/testtools/after-preprocessing-spelling-813460 into lp:testtools
Jonathan Lange has proposed merging lp:~jml/testtools/after-preprocessing-spelling-813460 into lp:testtools.
Requested reviews:
testtools developers (testtools-dev)
Related bugs:
Bug #813460 in testtools: ""AfterPreproccessing" misspelt"
https://bugs.launchpad.net/testtools/+bug/813460
For more details, see:
https://code.launchpad.net/~jml/testtools/after-preprocessing-spelling-813460/+merge/68533
Renames AfterPreproccessing to AfterPreprocessing. Preserves old name for backwards compatibility.
--
https://code.launchpad.net/~jml/testtools/after-preprocessing-spelling-813460/+merge/68533
Your team testtools developers is requested to review the proposed merge of lp:~jml/testtools/after-preprocessing-spelling-813460 into lp:testtools.
=== modified file 'NEWS'
--- NEWS 2011-07-20 08:48:46 +0000
+++ NEWS 2011-07-20 12:14:31 +0000
@@ -4,6 +4,15 @@
NEXT
~~~~
+Changes
+-------
+
+* ``AfterPreproccessing`` renamed to ``AfterPreproccesing``, which is a more
+ correct spelling. Old name preserved for backwards compatibility, but is
+ now deprecated. Please stop using it.
+ (Jonathan Lange, #813460)
+
+
Improvements
------------
=== modified file 'doc/for-test-authors.rst'
--- doc/for-test-authors.rst 2011-07-19 15:37:07 +0000
+++ doc/for-test-authors.rst 2011-07-20 12:14:31 +0000
@@ -485,7 +485,7 @@
def HasFileContent(content):
def _read(path):
return open(path).read()
- return AfterPreproccessing(_read, Equals(content))
+ return AfterPreprocessing(_read, Equals(content))
self.assertThat('/tmp/foo.txt', PathHasFileContent("Hello world!"))
=== modified file 'testtools/matchers.py'
--- testtools/matchers.py 2011-07-20 08:48:46 +0000
+++ testtools/matchers.py 2011-07-20 12:14:31 +0000
@@ -12,7 +12,7 @@
__metaclass__ = type
__all__ = [
- 'AfterPreproccessing',
+ 'AfterPreprocessing',
'Annotate',
'DocTestMatches',
'EndsWith',
@@ -811,7 +811,7 @@
).match(not_matched[:common_length])
-class AfterPreproccessing(object):
+class AfterPreprocessing(object):
"""Matches if the value matches after passing through a function.
This can be used to aid in creating trivial matchers as functions, for
@@ -820,7 +820,7 @@
def PathHasFileContent(content):
def _read(path):
return open(path).read()
- return AfterPreproccessing(_read, Equals(content))
+ return AfterPreprocessing(_read, Equals(content))
"""
def __init__(self, preprocessor, matcher):
@@ -833,7 +833,7 @@
return str(self.preprocessor)
def __str__(self):
- return "AfterPreproccessing(%s, %s)" % (
+ return "AfterPreprocessing(%s, %s)" % (
self._str_preprocessor(), self.matcher)
def match(self, value):
@@ -841,3 +841,8 @@
return Annotate(
"after %s" % self._str_preprocessor(),
self.matcher).match(value)
+
+
+# This is the old, deprecated. spelling of the name, kept for backwards
+# compatibility.
+AfterPreproccessing = AfterPreprocessing
=== modified file 'testtools/tests/test_matchers.py'
--- testtools/tests/test_matchers.py 2011-07-20 08:46:46 +0000
+++ testtools/tests/test_matchers.py 2011-07-20 12:14:31 +0000
@@ -14,7 +14,7 @@
StringIO,
)
from testtools.matchers import (
- AfterPreproccessing,
+ AfterPreprocessing,
Annotate,
AnnotatedMismatch,
Equals,
@@ -698,24 +698,24 @@
re.S))
-class TestAfterPreproccessing(TestCase, TestMatchersInterface):
+class TestAfterPreprocessing(TestCase, TestMatchersInterface):
def parity(x):
return x % 2
- matches_matcher = AfterPreproccessing(parity, Equals(1))
+ matches_matcher = AfterPreprocessing(parity, Equals(1))
matches_matches = [3, 5]
matches_mismatches = [2]
str_examples = [
- ("AfterPreproccessing(<function parity>, Equals(1))",
- AfterPreproccessing(parity, Equals(1))),
+ ("AfterPreprocessing(<function parity>, Equals(1))",
+ AfterPreprocessing(parity, Equals(1))),
]
describe_examples = [
("1 != 0: after <function parity>",
2,
- AfterPreproccessing(parity, Equals(1))),
+ AfterPreprocessing(parity, Equals(1))),
]
Follow ups