This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch gc/8494
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 227284fcd3985259878ab26327f69afb8a6deddd
Author: Guillermo Cruz <[email protected]>
AuthorDate: Mon Jan 23 17:27:51 2023 +0000

    fixup! [#8494] test fixes
---
 Allura/allura/tests/test_helpers.py                |  4 ++--
 Allura/allura/tests/test_tasks.py                  |  4 ++--
 .../forgegit/tests/functional/test_controllers.py  | 28 ++++++++++++++--------
 ForgeSVN/forgesvn/tests/test_tasks.py              |  2 +-
 4 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Allura/allura/tests/test_helpers.py 
b/Allura/allura/tests/test_helpers.py
index c686a9e32..931c6908c 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -266,11 +266,11 @@ def test_render_any_markup_plain():
 
 def test_render_any_markup_formatting():
     assert (str(h.render_any_markup('README.md', '### foo\n'
-                                    '    <script>alert(1)</script> bar')) ==
+                                    '    <script>alert(1)</script>bar')) ==
             '<div class="markdown_content"><h3 id="foo">foo</h3>\n'
             '<div class="codehilite"><pre><span></span><code><span class="nt">'
             '&lt;script&gt;</span>alert(1)<span class="nt">'
-            '&lt;/script&gt;</span> bar\n</code></pre></div>\n</div>')
+            '&lt;/script&gt;</span>bar\n</code></pre></div>\n</div>')
 
 
 def test_render_any_markdown_encoding():
diff --git a/Allura/allura/tests/test_tasks.py 
b/Allura/allura/tests/test_tasks.py
index 275c36455..a4cfdbe86 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -579,8 +579,8 @@ class TestNotificationTasks(unittest.TestCase):
         with mock.patch.object(M.Mailbox, 'deliver') as deliver:
             with mock.patch.object(M.Mailbox, 'fire_ready') as fire_ready:
                 notification_tasks.notify('42', ['52'], 'none')
-                assert deliver.called_with('42', ['52'], 'none')
-                assert fire_ready.called_with()
+                deliver.assert_called_with('42', ['52'], 'none')
+                fire_ready.assert_called_with()
 
 
 @event_handler('my_event')
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py 
b/ForgeGit/forgegit/tests/functional/test_controllers.py
index d42d91239..22c8d7f85 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -334,12 +334,20 @@ class TestRootController(_TestCase):
         ci = self._get_ci(repo='/p/test/weird-chars/')
         resp = self.app.get(h.urlquote(ci + 'tree/привіт.txt') + 
'?diff=407950e8fba4dbc108ffbce0128ed1085c52cfd7')
         diffhtml = str(resp.html.select_one('.diffbrowser'))
+        print("HTML", diffhtml)
+        print("=============================")
+        print(textwrap.dedent('''\
+                    <span class="gd">--- a/привіт.txt</span>
+                    <span class="gi">+++ b/привіт.txt</span>
+                    <span class="gu">@@ -1 +1,2 @@</span>
+                    <span class="w"> </span>Привіт!
+                    <span class="gi">+Which means Hello!</span>'''))
         assert (textwrap.dedent('''\
-                    <span class="gd">--- a/привіт.txt</span><span 
class="w"></span>
-                    <span class="gi">+++ b/привіт.txt</span><span 
class="w"></span>
-                    <span class="gu">@@ -1 +1,2 @@</span><span 
class="w"></span>
-                    <span class="w"> </span>Привіт!<span class="w"></span>
-                    <span class="gi">+Which means Hello!</span><span 
class="w"></span>''') in
+                    <span class="gd">--- a/привіт.txt</span>
+                    <span class="gi">+++ b/привіт.txt</span>
+                    <span class="gu">@@ -1 +1,2 @@</span>
+                    <span class="w"> </span>Привіт!
+                    <span class="gi">+Which means Hello!</span>''') in
                 diffhtml)
 
         resp = self.app.get(h.urlquote(ci + 'tree/привіт.txt') + 
'?diff=407950e8fba4dbc108ffbce0128ed1085c52cfd7&diformat=sidebyside')
@@ -903,11 +911,11 @@ class TestFork(_TestCase):
 </li>
 </ul>
 <p>Diff:</p>
-<div class="codehilite"><pre><span></span><code><span class="gd">--- 
old</span><span class="w"></span>
-<span class="gi">+++ new</span><span class="w"></span>
-<span class="gu">@@ -1 +1 @@</span><span class="w"></span>
-<span class="gd">-description</span><span class="w"></span>
-<span class="gi">+changed description</span><span class="w"></span>
+<div class="codehilite"><pre><span></span><code><span class="gd">--- old</span>
+<span class="gi">+++ new</span>
+<span class="gu">@@ -1 +1 @@</span>
+<span class="gd">-description</span>
+<span class="gi">+changed description</span>
 </code></pre></div>
 </div>
 """.strip()
diff --git a/ForgeSVN/forgesvn/tests/test_tasks.py 
b/ForgeSVN/forgesvn/tests/test_tasks.py
index b4d939eaa..f84d9dafe 100644
--- a/ForgeSVN/forgesvn/tests/test_tasks.py
+++ b/ForgeSVN/forgesvn/tests/test_tasks.py
@@ -55,7 +55,7 @@ class TestRepoTasks(unittest.TestCase):
         with mock.patch.object(c.app.repo, 'init') as f:
             repo_tasks.init()
             M.main_orm_session.flush()
-            assert f.called_with()
+            f.assert_called_with()
             assert ns == M.Notification.query.find().count()
 
     def test_clone(self):

Reply via email to