incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [4/5] git commit: [#6301] Fixed fragile test by ensuring consistent ordering of changed fields in post
Date Wed, 05 Mar 2014 16:24:41 GMT
[#6301] Fixed fragile test by ensuring consistent ordering of changed fields in post

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/dc1b7eb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/dc1b7eb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/dc1b7eb8

Branch: refs/heads/master
Commit: dc1b7eb809afcd9c68d646598b70cf434e83e3bf
Parents: 714cf87
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Wed Mar 5 16:11:28 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Mar 5 16:11:28 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py                |  4 ++--
 ForgeGit/forgegit/tests/functional/test_controllers.py | 12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dc1b7eb8/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index ad8a974..9cf6bfa 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -19,7 +19,7 @@ import os
 import logging
 import difflib
 from urllib import quote, unquote
-from collections import defaultdict
+from collections import defaultdict, OrderedDict
 from itertools import islice
 
 from paste.deploy.converters import asbool
@@ -405,7 +405,7 @@ class MergeRequestController(object):
     def do_request_merge_edit(self, **kw):
         require_access(self.req, 'write')
         kw = self.mr_widget_edit.to_python(kw)
-        changes = dict()
+        changes = OrderedDict()
         if self.req.summary != kw['summary']:
             changes['Summary'] = [self.req.summary, kw['summary']]
             self.req.summary = kw['summary']

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/dc1b7eb8/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index d7bc19f..5c85e2c 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -21,6 +21,7 @@ import os
 import shutil
 import tempfile
 
+from datadiff.tools import assert_equal as dd_assert_equal
 from nose.tools import assert_equal, assert_in, assert_not_in
 import tg
 import pkg_resources
@@ -632,9 +633,12 @@ class TestFork(_TestCase):
         assert '<p>changed description</p' in r
         assert 'Merge Request #1: changed summary (open)' in r
         changes = r.html.findAll('div', attrs={'class': 'markdown_content'})[-1]
-        assert unicode(changes) == """
+        dd_assert_equal(unicode(changes), """
 <div class="markdown_content"><ul>
 <li>
+<p><strong>Summary</strong>: summary --&gt; changed summary</p>
+</li>
+<li>
 <p><strong>Source branch</strong>: zz --&gt; master</p>
 </li>
 <li>
@@ -648,10 +652,8 @@ class TestFork(_TestCase):
 <span class="gd">-description</span>
 <span class="gi">+changed description</span>
 </pre></div>
-<ul>
-<li><strong>Summary</strong>: summary --&gt; changed summary</li>
-</ul></div>
-""".strip()
+</div>
+""".strip())
 
         r = self.app.get('/p/test/src-git/merge-requests')
         assert '<a href="1/">changed summary</a>' in r


Mime
View raw message