Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(510)

Issue 11967043: make_text_diff function and tests (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by ana.balica
Modified:
10 years, 9 months ago
Reviewers:
thomas.j.waldmann
Visibility:
Public.

Description

make_text_diff() function will pick diff tuples (returned by MoinMoin/util/diff_datastruct.py) and will transform them to strings. The text will be used for visualization of diffs in moin UI and in mail notifications about meta changes.

Patch Set 1 #

Total comments: 3

Patch Set 2 : Fix tests #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -1 line) Patch
M MoinMoin/util/_tests/test_diff_datastruct.py View 1 2 chunks +50 lines, -1 line 3 comments Download
M MoinMoin/util/diff_datastruct.py View 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 7
Thomas.J.Waldmann
https://codereview.appspot.com/11967043/diff/1/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11967043/diff/1/MoinMoin/util/_tests/test_diff_datastruct.py#newcode108 MoinMoin/util/_tests/test_diff_datastruct.py:108: for got, expected in zip(make_text_diff(changes), results): same mistake as ...
10 years, 9 months ago (2013-07-27 18:04:27 UTC) #1
ana.balica
https://codereview.appspot.com/11967043/diff/1/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11967043/diff/1/MoinMoin/util/_tests/test_diff_datastruct.py#newcode108 MoinMoin/util/_tests/test_diff_datastruct.py:108: for got, expected in zip(make_text_diff(changes), results): On 2013/07/27 18:04:28, ...
10 years, 9 months ago (2013-07-27 18:13:09 UTC) #2
Thomas.J.Waldmann
I'ld change it. If you think one tuple is too much for one line, put ...
10 years, 9 months ago (2013-07-27 18:18:21 UTC) #3
Thomas.J.Waldmann
10 years, 9 months ago (2013-07-27 18:18:26 UTC) #4
ana.balica
https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode15 MoinMoin/util/_tests/test_diff_datastruct.py:15: def _test_make_text_diff(self, tests): Decided to create an extra method, ...
10 years, 9 months ago (2013-07-27 19:16:15 UTC) #5
Thomas.J.Waldmann
https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_diff_datastruct.py File MoinMoin/util/_tests/test_diff_datastruct.py (right): https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_diff_datastruct.py#newcode18 MoinMoin/util/_tests/test_diff_datastruct.py:18: assert got == expected make the assertion fail somehow ...
10 years, 9 months ago (2013-07-27 19:25:11 UTC) #6
ana.balica
10 years, 9 months ago (2013-07-27 19:59:43 UTC) #7
https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_d...
File MoinMoin/util/_tests/test_diff_datastruct.py (right):

https://codereview.appspot.com/11967043/diff/9001/MoinMoin/util/_tests/test_d...
MoinMoin/util/_tests/test_diff_datastruct.py:18: assert got == expected
On 2013/07/27 19:25:11, Thomas.J.Waldmann wrote:
> make the assertion fail somehow - does one still see good enough, what test /
> with what data is failing?

On fail one can see the values (got and expected) and also where the failing
comes from - the test function.

Sample output:
    def test_make_text_diff_float(self):
        tests = [([(INSERT, [], 1.2)], u"+1.2"),
                 ([(DELETE, [], 3.4)], u"- 3.4")]
^       self._test_make_text_diff(tests)
[...]
            for got in make_text_diff(changes):
^               assert got == expected
E               assert '+ 1.2' == u'+1.2'

^ equals >
What extra information it might require?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b