# HG changeset patch # User Marcin Kuzminski # Date 2019-07-29 11:01:18 # Node ID 927faae7d2bc636b2e1ff7f68bc54bae7447bab2 # Parent bd716eb628808c82e90d09630d42873e1881d764 tests: fixes after some later code changes diff --git a/rhodecode/api/tests/test_get_pull_request.py b/rhodecode/api/tests/test_get_pull_request.py --- a/rhodecode/api/tests/test_get_pull_request.py +++ b/rhodecode/api/tests/test_get_pull_request.py @@ -38,7 +38,7 @@ class TestGetPullRequest(object): pull_request = pr_util.create_pull_request(mergeable=True) id_, params = build_data( self.apikey, 'get_pull_request', - pullrequestid=pull_request.pull_request_id) + pullrequestid=pull_request.pull_request_id, merge_state=True) response = api_call(self.app, params) diff --git a/rhodecode/apps/repository/tests/test_repo_commits.py b/rhodecode/apps/repository/tests/test_repo_commits.py --- a/rhodecode/apps/repository/tests/test_repo_commits.py +++ b/rhodecode/apps/repository/tests/test_repo_commits.py @@ -79,13 +79,19 @@ class TestRepoCommitView(object): 'git': '03fa803d7e9fb14daa9a3089e0d1494eda75d986', 'svn': '337', } + diff_stat = { + 'git': '20 files changed: 941 inserted, 286 deleted', + 'svn': '21 files changed: 943 inserted, 288 deleted', + 'hg': '21 files changed: 943 inserted, 288 deleted', + + } commit_id = commit_id[backend.alias] response = self.app.get(route_path( 'repo_commit', repo_name=backend.repo_name, commit_id=commit_id)) response.mustcontain(_shorten_commit_id(commit_id)) - response.mustcontain('21 files changed: 943 inserted, 288 deleted') + response.mustcontain(diff_stat[backend.alias]) # files op files response.mustcontain('File not present at commit: %s' % @@ -127,6 +133,10 @@ class TestRepoCommitView(object): response.mustcontain('1 file changed: 5 inserted, 1 deleted') response.mustcontain('12 files changed: 236 inserted, 22 deleted') response.mustcontain('21 files changed: 943 inserted, 288 deleted') + elif backend.alias == 'git': + response.mustcontain('new file 100644') + response.mustcontain('12 files changed: 222 inserted, 20 deleted') + response.mustcontain('20 files changed: 941 inserted, 286 deleted') else: response.mustcontain('new file 100644') response.mustcontain('12 files changed: 222 inserted, 20 deleted') @@ -170,6 +180,9 @@ class TestRepoCommitView(object): if backend.alias == 'svn': response.mustcontain('new file 10644') response.mustcontain('32 files changed: 1179 inserted, 310 deleted') + elif backend.alias == 'git': + response.mustcontain('new file 100644') + response.mustcontain('31 files changed: 1163 inserted, 306 deleted') else: response.mustcontain('new file 100644') response.mustcontain('32 files changed: 1165 inserted, 308 deleted') @@ -246,7 +259,7 @@ new file mode 120000 """, 'git': r"""diff --git a/README b/README new file mode 120000 -index 0000000000000000000000000000000000000000..92cacd285355271487b7e379dba6ca60f9a554a4 +index 0000000..92cacd2 --- /dev/null +++ b/README @@ -0,0 +1 @@ diff --git a/rhodecode/apps/repository/tests/test_repo_compare_local.py b/rhodecode/apps/repository/tests/test_repo_compare_local.py --- a/rhodecode/apps/repository/tests/test_repo_compare_local.py +++ b/rhodecode/apps/repository/tests/test_repo_compare_local.py @@ -102,7 +102,7 @@ class TestCompareView(object): 'git': { 'tag': 'v0.2.2', 'branch': 'master', - 'response': (71, 2269, 3416) + 'response': (70, 1855, 3002) }, } diff --git a/rhodecode/apps/repository/tests/test_repo_compare_on_single_file.py b/rhodecode/apps/repository/tests/test_repo_compare_on_single_file.py --- a/rhodecode/apps/repository/tests/test_repo_compare_on_single_file.py +++ b/rhodecode/apps/repository/tests/test_repo_compare_on_single_file.py @@ -54,7 +54,7 @@ class TestSideBySideDiff(object): 'git': { 'commits': ['6fc9270775aaf5544c1deb014f4ddd60c952fcbb', '03fa803d7e9fb14daa9a3089e0d1494eda75d986'], - 'changes': '21 files changed: 943 inserted, 288 deleted' + 'changes': '20 files changed: 941 inserted, 286 deleted' }, 'svn': { @@ -92,7 +92,7 @@ class TestSideBySideDiff(object): 'git': { 'commits': ['f5fbf9cfd5f1f1be146f6d3b38bcd791a7480c13', '03fa803d7e9fb14daa9a3089e0d1494eda75d986'], - 'changes': '32 files changed: 1165 inserted, 308 deleted' + 'changes': '31 files changed: 1163 inserted, 306 deleted' }, 'svn': { diff --git a/rhodecode/tests/vcs/test_diff.py b/rhodecode/tests/vcs/test_diff.py --- a/rhodecode/tests/vcs/test_diff.py +++ b/rhodecode/tests/vcs/test_diff.py @@ -153,7 +153,7 @@ class TestRepositoryGetDiff(BackendTestM first_commit_diffs = { 'git': r"""diff --git a/foobar b/foobar new file mode 100644 -index 0000000000000000000000000000000000000000..f6ea0495187600e7b2288c8ac19c5886383a4632 +index 0000000..f6ea049 --- /dev/null +++ b/foobar @@ -0,0 +1 @@ @@ -161,7 +161,7 @@ index 0000000000000000000000000000000000 \ No newline at end of file diff --git a/foobar2 b/foobar2 new file mode 100644 -index 0000000000000000000000000000000000000000..e8c9d6b98e3dce993a464935e1a53f50b56a3783 +index 0000000..e8c9d6b --- /dev/null +++ b/foobar2 @@ -0,0 +1 @@ @@ -206,7 +206,7 @@ new file mode 10644 second_commit_diffs = { 'git': r"""diff --git a/foobar b/foobar -index f6ea0495187600e7b2288c8ac19c5886383a4632..389865bb681b358c9b102d79abd8d5f941e96551 100644 +index f6ea049..389865b 100644 --- a/foobar +++ b/foobar @@ -1 +1 @@ @@ -216,7 +216,7 @@ index f6ea0495187600e7b2288c8ac19c588638 \ No newline at end of file diff --git a/foobar3 b/foobar3 new file mode 100644 -index 0000000000000000000000000000000000000000..c11c37d41d33fb47741cff93fa5f9d798c1535b0 +index 0000000..c11c37d --- /dev/null +++ b/foobar3 @@ -0,0 +1 @@ @@ -264,14 +264,14 @@ new file mode 10644 third_commit_diffs = { 'git': r"""diff --git a/foobar b/foobar deleted file mode 100644 -index 389865bb681b358c9b102d79abd8d5f941e96551..0000000000000000000000000000000000000000 +index 389865b..0000000 --- a/foobar +++ /dev/null @@ -1 +0,0 @@ -FOOBAR \ No newline at end of file diff --git a/foobar3 b/foobar3 -index c11c37d41d33fb47741cff93fa5f9d798c1535b0..f9324477362684ff692aaf5b9a81e01b9e9a671c 100644 +index c11c37d..f932447 100644 --- a/foobar3 +++ b/foobar3 @@ -1 +1,3 @@ @@ -324,7 +324,7 @@ diff --git a/foobar3 b/foobar3 first_commit_one_file = { 'git': r"""diff --git a/foobar b/foobar new file mode 100644 -index 0000000000000000000000000000000000000000..f6ea0495187600e7b2288c8ac19c5886383a4632 +index 0000000..f6ea049 --- /dev/null +++ b/foobar @@ -0,0 +1 @@ @@ -352,7 +352,7 @@ new file mode 10644 } -class TestSvnGetDiff: +class TestSvnGetDiff(object): @pytest.mark.parametrize('path, path1', [ ('trunk/example.py', 'tags/v0.2/example.py'), @@ -451,10 +451,10 @@ new file mode 100644 index 0000000000000000000000000000000000000000..28380fd4a25c58be1b68b523ba2a314f4459ee9c GIT binary patch literal 19 -YcmeAS@N?(olHy`uVBq!ia0vp^03%2O-T(jq +Yc%17D@N?(olHy`uVBq!ia0vp^03%2O-T(jq literal 0 -HcmV?d00001 +Hc$@