Merge lp:~jml/testtools/after-preprocessing-spelling-813460 into lp:~testtools-committers/testtools/trunk

Proposed by Jonathan Lange
Status: Merged
Approved by: Robert Collins
Approved revision: 208
Merged at revision: 206
Proposed branch: lp:~jml/testtools/after-preprocessing-spelling-813460
Merge into: lp:~testtools-committers/testtools/trunk
Diff against target: 122 lines (+25/-11)
4 files modified
NEWS (+9/-0)
doc/for-test-authors.rst (+1/-1)
testtools/matchers.py (+9/-4)
testtools/tests/test_matchers.py (+6/-6)
To merge this branch: bzr merge lp:~jml/testtools/after-preprocessing-spelling-813460
Reviewer Review Type Date Requested Status
Robert Collins Approve
Review via email: mp+68533@code.launchpad.net

Description of the change

Renames AfterPreproccessing to AfterPreprocessing. Preserves old name for backwards compatibility.

To post a comment you must log in.
208. By Jonathan Lange

Fix typo.

Revision history for this message
Robert Collins (lifeless) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2011-07-20 08:48:46 +0000
3+++ NEWS 2011-07-20 20:34:39 +0000
4@@ -4,6 +4,15 @@
5 NEXT
6 ~~~~
7
8+Changes
9+-------
10+
11+* ``AfterPreproccessing`` renamed to ``AfterPreprocessing``, which is a more
12+ correct spelling. Old name preserved for backwards compatibility, but is
13+ now deprecated. Please stop using it.
14+ (Jonathan Lange, #813460)
15+
16+
17 Improvements
18 ------------
19
20
21=== modified file 'doc/for-test-authors.rst'
22--- doc/for-test-authors.rst 2011-07-19 15:37:07 +0000
23+++ doc/for-test-authors.rst 2011-07-20 20:34:39 +0000
24@@ -485,7 +485,7 @@
25 def HasFileContent(content):
26 def _read(path):
27 return open(path).read()
28- return AfterPreproccessing(_read, Equals(content))
29+ return AfterPreprocessing(_read, Equals(content))
30 self.assertThat('/tmp/foo.txt', PathHasFileContent("Hello world!"))
31
32
33
34=== modified file 'testtools/matchers.py'
35--- testtools/matchers.py 2011-07-20 08:48:46 +0000
36+++ testtools/matchers.py 2011-07-20 20:34:39 +0000
37@@ -12,7 +12,7 @@
38
39 __metaclass__ = type
40 __all__ = [
41- 'AfterPreproccessing',
42+ 'AfterPreprocessing',
43 'Annotate',
44 'DocTestMatches',
45 'EndsWith',
46@@ -811,7 +811,7 @@
47 ).match(not_matched[:common_length])
48
49
50-class AfterPreproccessing(object):
51+class AfterPreprocessing(object):
52 """Matches if the value matches after passing through a function.
53
54 This can be used to aid in creating trivial matchers as functions, for
55@@ -820,7 +820,7 @@
56 def PathHasFileContent(content):
57 def _read(path):
58 return open(path).read()
59- return AfterPreproccessing(_read, Equals(content))
60+ return AfterPreprocessing(_read, Equals(content))
61 """
62
63 def __init__(self, preprocessor, matcher):
64@@ -833,7 +833,7 @@
65 return str(self.preprocessor)
66
67 def __str__(self):
68- return "AfterPreproccessing(%s, %s)" % (
69+ return "AfterPreprocessing(%s, %s)" % (
70 self._str_preprocessor(), self.matcher)
71
72 def match(self, value):
73@@ -841,3 +841,8 @@
74 return Annotate(
75 "after %s" % self._str_preprocessor(),
76 self.matcher).match(value)
77+
78+
79+# This is the old, deprecated. spelling of the name, kept for backwards
80+# compatibility.
81+AfterPreproccessing = AfterPreprocessing
82
83=== modified file 'testtools/tests/test_matchers.py'
84--- testtools/tests/test_matchers.py 2011-07-20 08:46:46 +0000
85+++ testtools/tests/test_matchers.py 2011-07-20 20:34:39 +0000
86@@ -14,7 +14,7 @@
87 StringIO,
88 )
89 from testtools.matchers import (
90- AfterPreproccessing,
91+ AfterPreprocessing,
92 Annotate,
93 AnnotatedMismatch,
94 Equals,
95@@ -698,24 +698,24 @@
96 re.S))
97
98
99-class TestAfterPreproccessing(TestCase, TestMatchersInterface):
100+class TestAfterPreprocessing(TestCase, TestMatchersInterface):
101
102 def parity(x):
103 return x % 2
104
105- matches_matcher = AfterPreproccessing(parity, Equals(1))
106+ matches_matcher = AfterPreprocessing(parity, Equals(1))
107 matches_matches = [3, 5]
108 matches_mismatches = [2]
109
110 str_examples = [
111- ("AfterPreproccessing(<function parity>, Equals(1))",
112- AfterPreproccessing(parity, Equals(1))),
113+ ("AfterPreprocessing(<function parity>, Equals(1))",
114+ AfterPreprocessing(parity, Equals(1))),
115 ]
116
117 describe_examples = [
118 ("1 != 0: after <function parity>",
119 2,
120- AfterPreproccessing(parity, Equals(1))),
121+ AfterPreprocessing(parity, Equals(1))),
122 ]
123
124

Subscribers

People subscribed via source and target branches