From e64141c2a39a0478205efe81586e5ce19a9834e4 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Dec 14 2015 16:08:54 +0000 Subject: Fix unit-tests for the change of behavior --- diff --git a/tests/test_progit_flask_ui_fork.py b/tests/test_progit_flask_ui_fork.py index d2330ac..59fed44 100644 --- a/tests/test_progit_flask_ui_fork.py +++ b/tests/test_progit_flask_ui_fork.py @@ -1576,7 +1576,7 @@ index 0000000..2a552bb output = self.app.get('/test/pull-request/1/comment/1/edit') self.assertEqual(output.status_code, 200) - self.assertIn('
', output.data) + self.assertIn('
', output.data) # Checking if the comment is there in the update page self.assertIn( 'This look alright but we can do better', output.data) @@ -1617,6 +1617,7 @@ index 0000000..2a552bb follow_redirects=True) self.assertEqual(output.status_code, 404) + if __name__ == '__main__': SUITE = unittest.TestLoader().loadTestsFromTestCase(PagureFlaskForktests) unittest.TextTestRunner(verbosity=2).run(SUITE) diff --git a/tests/test_progit_lib_git.py b/tests/test_progit_lib_git.py index be81c42..2615f6e 100644 --- a/tests/test_progit_lib_git.py +++ b/tests/test_progit_lib_git.py @@ -454,7 +454,7 @@ index 9f44358..2a552bb 100644 patch = pagure.lib.git.commit_to_patch(repo, commit) exp = """Mon Sep 17 00:00:00 2001 From: pagure -Subject: Updated ticket : Test issue +Subject: Updated issue : Test issue --- @@ -501,7 +501,7 @@ index 0000000..60f7480 row[2] = 'a/123' row[3] = 'b/456' row = ' '.join(row) - elif 'Updated ticket' in row: + elif 'Updated issue' in row: row = row.split() row[3] = ':' row = ' '.join(row) @@ -534,7 +534,7 @@ index 0000000..60f7480 patch = pagure.lib.git.commit_to_patch(repo, commit) exp = """Mon Sep 17 00:00:00 2001 From: pagure -Subject: Updated ticket : Test issue +Subject: Updated issue : Test issue --- @@ -543,7 +543,7 @@ diff --git a/123 b/456 index 458821a..77674a8 --- a/123 +++ b/456 -@@ -1,7 +1,22 @@ +@@ -1,7 +1,24 @@ { "assignee": null, "blocks": [], @@ -552,6 +552,8 @@ index 458821a..77674a8 + { + "comment": "Hey look a comment!", + "date_created": null, ++ "edited_on": null, ++ "editor": null, + "id": 1, + "parent": null, + "user": { @@ -580,7 +582,7 @@ index 458821a..77674a8 row[2] = 'a/123' row[3] = 'b/456' row = ' '.join(row) - elif 'Updated ticket' in row: + elif 'Updated issue' in row: row = row.split() row[3] = ':' row = ' '.join(row) @@ -679,7 +681,7 @@ index 458821a..77674a8 patch = pagure.lib.git.commit_to_patch(repo, commit) exp = """Mon Sep 17 00:00:00 2001 From: pagure -Subject: Updated ticket : test PR +Subject: Updated pull-request : test PR --- @@ -782,7 +784,7 @@ index 0000000..60f7480 row[2] = 'a/123' row[3] = 'b/456' row = ' '.join(row) - elif 'Updated ticket' in row: + elif 'Updated pull-request' in row: row = row.split() row[3] = ':' row = ' '.join(row) @@ -1221,7 +1223,7 @@ index 0000000..60f7480 ['log', '-1', "--pretty='%s'"], gitrepo) self.assertEqual(len(output), 1) self.assertTrue( - output[0].startswith("'Updated ticket ") + output[0].startswith("'Updated issue ") ) self.assertTrue( output[0].endswith(": Test issue'")