From 1c98d707ce2bccba4efc93bf627aebd609f5dc6e Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 21 2016 10:31:51 +0000 Subject: [PATCH 1/3] Small style changes --- diff --git a/pagure/templates/file.html b/pagure/templates/file.html index 9259785..fb8377a 100644 --- a/pagure/templates/file.html +++ b/pagure/templates/file.html @@ -55,7 +55,7 @@ {% if output_type=='file' %} {% autoescape false %} - {{ content | format_loc}} + {{ content | format_loc }} {% endautoescape %} {% elif output_type == 'markup' %} {% autoescape false %} @@ -80,7 +80,7 @@
- {% for entry in content %} + {% for entry in content %} - {% endfor %} + {% endfor %}
{% if entry.filemode == 16384 %} @@ -100,9 +100,9 @@ {% if entry.filemode == 16384 %}{% endif%} - {{ entry.hex|short }} + {{ entry.hex|short }}
From fcf62c1b31b35f558157e961a194635b78866973 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 21 2016 10:32:34 +0000 Subject: [PATCH 2/3] Adjust the unit-tests for the style change --- diff --git a/tests/test_pagure_flask_ui_no_master_branch.py b/tests/test_pagure_flask_ui_no_master_branch.py index efcdd4f..654e910 100644 --- a/tests/test_pagure_flask_ui_no_master_branch.py +++ b/tests/test_pagure_flask_ui_no_master_branch.py @@ -293,7 +293,7 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests): self.assertIn('', output.data) self.assertIn( '\n' - ' 9f4435\n ', + ' 9f4435\n ', output.data) output = self.app.get('/test/tree/feature/sources') diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py index 84f3fe8..ec477ef 100644 --- a/tests/test_pagure_flask_ui_slash_branch_name.py +++ b/tests/test_pagure_flask_ui_slash_branch_name.py @@ -303,7 +303,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.assertIn('', output.data) self.assertIn( '\n' - ' 9f4435', output.data) + ' 9f4435', output.data) self.assertEqual( output.data.count(''), 1) @@ -314,10 +314,10 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): output.data) self.assertIn( '\n' - ' 9f4435', output.data) + ' 9f4435', output.data) self.assertIn( '\n' - ' e4e5f6', output.data) + ' e4e5f6', output.data) self.assertEqual( output.data.count(''), 2) @@ -327,7 +327,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests): self.assertIn('', output.data) self.assertIn( '\n' - ' 9f4435', output.data) + ' 9f4435', output.data) self.assertEqual( output.data.count(''), 1) From 0cbbd3647e3dae8aefb6f6817f6ae469e95a67ae Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 21 2016 10:36:38 +0000 Subject: [PATCH 3/3] Adjust the unit-tests for the change in behavior in pygments 2.1.3 --- diff --git a/tests/test_pagure_flask_ui_no_master_branch.py b/tests/test_pagure_flask_ui_no_master_branch.py index 654e910..7b1de81 100644 --- a/tests/test_pagure_flask_ui_no_master_branch.py +++ b/tests/test_pagure_flask_ui_no_master_branch.py @@ -230,8 +230,13 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests): '
  • ' '  sources
  • ', output.data) - self.assertIn( - '
    foo
    ', output.data) + self.assertTrue( + # new version of pygments + '
    foo
    ' in output.data + or + # old version of pygments + '
    foo
    ' in output.data + ) @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 39b5140..ad24261 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -1091,6 +1091,14 @@ class PagureFlaskRepotests(tests.Modeltests): self.assertTrue('
    Authored by Alice Author' in output.data) self.assertTrue('Committed by Cecil Committer' in output.data) self.assertTrue( + # new version of pygments + '
    ' + '
    '
    +            ''
    +            ''
    +            '@@ -0,0 +1,3 @@' in output.data
    +            or
    +            # old version of pygments
                 '
    ' '
    '
                 ''
    diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py
    index ec477ef..61cb737 100644
    --- a/tests/test_pagure_flask_ui_slash_branch_name.py
    +++ b/tests/test_pagure_flask_ui_slash_branch_name.py
    @@ -233,7 +233,12 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests):
                 '
  • ' '  .gitignore
  • ', output.data) - self.assertIn('
    *~
    ', output.data) + self.assertTrue( + # new version of pygments + '
    *~
    ' in output.data + or + # old version of pygments + '
    *~
    ' in output.data) @patch('pagure.lib.notify.send_email') def test_view_raw_file(self, send_email):