diff --git a/pagure/templates/_repo_renderdiff.html b/pagure/templates/_repo_renderdiff.html index a3997a6..f3d898d 100644 --- a/pagure/templates/_repo_renderdiff.html +++ b/pagure/templates/_repo_renderdiff.html @@ -260,7 +260,7 @@ {% else %}
diff --git a/pagure/ui/diff_style.py b/pagure/ui/diff_style.py
deleted file mode 100644
index 44cfda4..0000000
--- a/pagure/ui/diff_style.py
+++ /dev/null
@@ -1,111 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
- (c) 2016-2017 - Copyright Red Hat Inc
-
- Authors:
- Mark Reynolds ' % line)
+ output.append(
+ '%s
' % line)
output.append('')
tpl_edit = '%s
%s
' % line)
+ output.append(
+ ' ' % line)
output.append('')
output.append('%s
' in output_text
- or
- # old version of pygments
- 'foo
' in output_text
- )
+ self.assertIn(
+ 'foo
', output_text
+ )
@patch('pagure.lib.notify.send_email')
def test_view_raw_file(self, send_email):
diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py
index 2a23947..80d8b5d 100644
--- a/tests/test_pagure_flask_ui_repo.py
+++ b/tests/test_pagure_flask_ui_repo.py
@@ -2055,9 +2055,7 @@ class PagureFlaskRepotests(tests.Modeltests):
self.assertNotIn(
'id="show_hidden_commits"',
output_text)
- self.assertIn(
- '- ' +
- 'Row 0', output_text)
+ self.assertIn('foo
', output_text)
# View inverse commits comparison
output = self.app.get('/test/c/%s..%s' % (c1.oid.hex, c2.oid.hex))
self.assertEqual(output.status_code, 200)
@@ -2073,9 +2071,7 @@ class PagureFlaskRepotests(tests.Modeltests):
' %s\n ..\n %s\n' %
(c1.oid.hex, c2.oid.hex),
output_text)
- self.assertIn(
- '' +
- '+ Row 0', output_text)
+ self.assertIn('- Row 0
', output_text)
def compare_all(c1, c3):
# View commits comparison
@@ -2089,13 +2085,9 @@ class PagureFlaskRepotests(tests.Modeltests):
' %s\n ..\n %s\n' %
(c1.oid.hex, c3.oid.hex),
output_text)
- self.assertIn(
- '+ Row 0', output_text)
+ self.assertIn('+ Row 0
', output_text)
self.assertEqual(
- output_text.count(
- '+ Row 0'), 2)
+ output_text.count('+ Row 0
'), 2)
self.assertIn(
'1 more commits...',
output_text)
@@ -2120,11 +2112,8 @@ class PagureFlaskRepotests(tests.Modeltests):
(c3.oid.hex, c1.oid.hex),
output_text)
self.assertIn(
- '@@ -1,2 +1,1' +
- ' @@', output_text)
- self.assertIn(
- '- ' +
- 'Row 0', output_text)
+ '+ Row 0
', output_text)
+ self.assertIn('@@ -1,2 +1,1 @@
', output_text)
self.assertIn(
'1 more commits...',
output_text)
@@ -2218,7 +2207,7 @@ class PagureFlaskRepotests(tests.Modeltests):
'- Row 0
',
output_text)
self.assertIn(
- ' ', output_text)
+ ' bar
', output_text)
# Empty files should also be displayed
tests.add_content_to_git(
@@ -2317,11 +2306,9 @@ class PagureFlaskRepotests(tests.Modeltests):
self.assertIn(
' bar
', output_text)
- self.assertTrue(
- ' '
- in output_text
- or
- 'Row 0
' in output_text
+ self.assertIn(
+ 'Row 0
',
+ output_text
)
# Add a fork of a fork
@@ -2364,7 +2351,8 @@ class PagureFlaskRepotests(tests.Modeltests):
'Row 0
',
output_text)
self.assertIn(
- ' ', output_text)
+ ' barRow 0
',
+ output_text)
@patch(
'pagure.lib.encoding_utils.decode',
@@ -2562,7 +2550,7 @@ class PagureFlaskRepotests(tests.Modeltests):
' barRow 0
', output_text)
self.assertIn(
- ' ', output_text)
+ ' bar
', output_text)
data = regex.findall(output_text)
self.assertEqual(len(data), 2)
@@ -2580,7 +2568,7 @@ class PagureFlaskRepotests(tests.Modeltests):
' bar
', output_text)
self.assertIn(
- ' ', output_text)
+ ' bar
', output_text)
data = regex.findall(output_text)
self.assertEqual(len(data), 2)
@@ -2593,7 +2581,7 @@ class PagureFlaskRepotests(tests.Modeltests):
' bar
', output_text)
self.assertIn(
- ' ', output_text)
+ ' bar
', output_text)
data2 = regex.findall(output_text)
self.assertEqual(len(data2), 2)
self.assertNotEqual(data, data2)
@@ -2639,12 +2627,9 @@ class PagureFlaskRepotests(tests.Modeltests):
self.assertIn(
' bar
', output_text)
- self.assertTrue(
- ' '
- in output_text
- or
- 'Row 0
'
- in output_text
+ self.assertIn(
+ 'Row 0
',
+ output_text
)
# Add a fork of a fork
@@ -2678,7 +2663,8 @@ class PagureFlaskRepotests(tests.Modeltests):
'Row 0
', output_text)
self.assertIn(
- ' ', output_text)
+ ' barRow 0
',
+ output_text)
def test_view_blame_file_on_tag(self):
""" Test the view_blame_file endpoint. """
@@ -2710,7 +2696,7 @@ class PagureFlaskRepotests(tests.Modeltests):
' barRow 0
', output_text)
self.assertIn(
- ' ', output_text)
+ ' bar
', output_text)
data = regex.findall(output_text)
self.assertEqual(len(data), 2)
diff --git a/tests/test_pagure_flask_ui_repo_view_file.py b/tests/test_pagure_flask_ui_repo_view_file.py
index a79b7cc..cd551b3 100644
--- a/tests/test_pagure_flask_ui_repo_view_file.py
+++ b/tests/test_pagure_flask_ui_repo_view_file.py
@@ -104,8 +104,9 @@ class PagureFlaskRepoViewFiletests(LocalBasetests):
' bar
'
in output_text)
- self.assertTrue(
- ' ' in output_text)
+ self.assertIn(
+ ' bar
',
+ output_text)
def test_view_file_empty_file(self):
""" Test the view_file with an empty file. """
@@ -220,11 +221,9 @@ class PagureFlaskRepoViewFiletests(LocalBasetests):
self.assertIn(
' bar
', output_text)
- self.assertTrue(
- ' '
- in output_text
- or
- 'Row 0
' in output_text
+ self.assertIn(
+ 'Row 0
',
+ output_text
)
def test_view_file_fork_and_edit_logged_out(self):
@@ -328,7 +327,8 @@ class PagureFlaskRepoViewFileForktests(LocalBasetests):
'data-line-number="1">',
output_text)
self.assertIn(
- 'Row 0
', output_text)
+ ' barRow 0
',
+ output_text)
def test_view_file_fork_and_edit_on_fork_logged_out(self):
""" Test the view_file on a text file on a fork when logged out. """
diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py
index e98547a..7c09903 100644
--- a/tests/test_pagure_flask_ui_slash_branch_name.py
+++ b/tests/test_pagure_flask_ui_slash_branch_name.py
@@ -227,12 +227,8 @@ class PagureFlaskSlashInBranchtests(tests.SimplePagureTest):
.gitignore
''', output_text)
- self.assertTrue(
- # new version of pygments
- ' barRow 0
' in output_text
- or
- # old version of pygments
- '*~
' in output_text)
+ self.assertIn(
+ '*~
', output_text)
@patch('pagure.lib.notify.send_email')
def test_view_raw_file(self, send_email):
*~