##// END OF EJS Templates
tests: fixed further tests
marcink -
r3777:aceb6b16 new-ui
parent child Browse files
Show More
@@ -40,8 +40,8 b' def route_path(name, params=None, **kwar'
40 base_url = {
40 base_url = {
41 'repo_changelog': '/{repo_name}/changelog',
41 'repo_changelog': '/{repo_name}/changelog',
42 'repo_changelog_file': '/{repo_name}/changelog/{commit_id}/{f_path}',
42 'repo_changelog_file': '/{repo_name}/changelog/{commit_id}/{f_path}',
43 'repo_commits': '/{repo_name}/changelog',
43 'repo_commits': '/{repo_name}/commits',
44 'repo_commits_file': '/{repo_name}/changelog/{commit_id}/{f_path}',
44 'repo_commits_file': '/{repo_name}/commits/{commit_id}/{f_path}',
45 'pullrequest_show': '/{repo_name}/pull-request/{pull_request_id}',
45 'pullrequest_show': '/{repo_name}/pull-request/{pull_request_id}',
46 'pullrequest_show_all': '/{repo_name}/pull-request',
46 'pullrequest_show_all': '/{repo_name}/pull-request',
47 'pullrequest_show_all_data': '/{repo_name}/pull-request-data',
47 'pullrequest_show_all_data': '/{repo_name}/pull-request-data',
@@ -350,11 +350,11 b' class TestCreateReferenceData(object):'
350 {
350 {
351 'children': [
351 'children': [
352 {
352 {
353 'id': 'a', 'raw_id': 'a_id', 'text': 'a', 'type': 't1',
353 'id': 'a', 'idx': 0, 'raw_id': 'a_id', 'text': 'a', 'type': 't1',
354 'files_url': expected_files_url + 'a/?at=a',
354 'files_url': expected_files_url + 'a/?at=a',
355 },
355 },
356 {
356 {
357 'id': 'b', 'raw_id': 'b_id', 'text': 'b', 'type': 't1',
357 'id': 'b', 'idx': 0, 'raw_id': 'b_id', 'text': 'b', 'type': 't1',
358 'files_url': expected_files_url + 'b/?at=b',
358 'files_url': expected_files_url + 'b/?at=b',
359 }
359 }
360 ],
360 ],
@@ -363,7 +363,7 b' class TestCreateReferenceData(object):'
363 {
363 {
364 'children': [
364 'children': [
365 {
365 {
366 'id': 'c', 'raw_id': 'c_id', 'text': 'c', 'type': 't2',
366 'id': 'c', 'idx': 0, 'raw_id': 'c_id', 'text': 'c', 'type': 't2',
367 'files_url': expected_files_url + 'c/?at=c',
367 'files_url': expected_files_url + 'c/?at=c',
368 }
368 }
369 ],
369 ],
@@ -385,12 +385,12 b' class TestCreateReferenceData(object):'
385 {
385 {
386 'children': [
386 'children': [
387 {
387 {
388 'id': 'a@a_id', 'raw_id': 'a_id',
388 'id': 'a@a_id', 'idx': 0, 'raw_id': 'a_id',
389 'text': 'a', 'type': 't1',
389 'text': 'a', 'type': 't1',
390 'files_url': expected_files_url + 'a_id/a?at=a',
390 'files_url': expected_files_url + 'a_id/a?at=a',
391 },
391 },
392 {
392 {
393 'id': 'b@b_id', 'raw_id': 'b_id',
393 'id': 'b@b_id', 'idx': 0, 'raw_id': 'b_id',
394 'text': 'b', 'type': 't1',
394 'text': 'b', 'type': 't1',
395 'files_url': expected_files_url + 'b_id/b?at=b',
395 'files_url': expected_files_url + 'b_id/b?at=b',
396 }
396 }
@@ -400,7 +400,7 b' class TestCreateReferenceData(object):'
400 {
400 {
401 'children': [
401 'children': [
402 {
402 {
403 'id': 'c@c_id', 'raw_id': 'c_id',
403 'id': 'c@c_id', 'idx': 0, 'raw_id': 'c_id',
404 'text': 'c', 'type': 't2',
404 'text': 'c', 'type': 't2',
405 'files_url': expected_files_url + 'c_id/c?at=c',
405 'files_url': expected_files_url + 'c_id/c?at=c',
406 }
406 }
@@ -516,6 +516,7 b' class TestReferenceItems(object):'
516 'text': ref_name,
516 'text': ref_name,
517 'id': self._format_function(ref_name, ref_id),
517 'id': self._format_function(ref_name, ref_id),
518 'raw_id': ref_id,
518 'raw_id': ref_id,
519 'idx': 0,
519 'type': self.ref_type,
520 'type': self.ref_type,
520 'files_url': self.fake_url
521 'files_url': self.fake_url
521 }
522 }
@@ -1087,27 +1087,32 b' class TestGitSpecificWithRepo(BackendTes'
1087 'base')
1087 'base')
1088
1088
1089 def test_get_diff_runs_git_command_with_hashes(self):
1089 def test_get_diff_runs_git_command_with_hashes(self):
1090 comm1 = self.repo[0]
1091 comm2 = self.repo[1]
1090 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1092 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1091 self.repo.get_diff(self.repo[0], self.repo[1])
1093 self.repo.get_diff(comm1, comm2)
1094
1095 self.repo.run_git_command.assert_called_once_with(
1096 ['diff', '-U3', '--full-index', '--binary', '-p', '-M',
1097 '--abbrev=40', comm1.raw_id, comm2.raw_id])
1098
1099 def test_get_diff_runs_git_command_with_str_hashes(self):
1100 comm2 = self.repo[1]
1101 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1102 self.repo.get_diff(self.repo.EMPTY_COMMIT, comm2)
1103 self.repo.run_git_command.assert_called_once_with(
1104 ['show', '-U3', '--full-index', '--binary', '-p', '-M',
1105 '--abbrev=40', comm2.raw_id])
1106
1107 def test_get_diff_runs_git_command_with_path_if_its_given(self):
1108 comm1 = self.repo[0]
1109 comm2 = self.repo[1]
1110 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1111 self.repo.get_diff(comm1, comm2, 'foo')
1092 self.repo.run_git_command.assert_called_once_with(
1112 self.repo.run_git_command.assert_called_once_with(
1093 ['diff', '-U3', '--full-index', '--binary', '-p', '-M',
1113 ['diff', '-U3', '--full-index', '--binary', '-p', '-M',
1094 '--abbrev=40', self.repo._lookup_commit(0),
1114 '--abbrev=40', self.repo._lookup_commit(0),
1095 self.repo._lookup_commit(1)])
1115 comm2.raw_id, '--', 'foo'])
1096
1097 def test_get_diff_runs_git_command_with_str_hashes(self):
1098 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1099 self.repo.get_diff(self.repo.EMPTY_COMMIT, self.repo[1])
1100 self.repo.run_git_command.assert_called_once_with(
1101 ['show', '-U3', '--full-index', '--binary', '-p', '-M',
1102 '--abbrev=40', self.repo._lookup_commit(1)])
1103
1104 def test_get_diff_runs_git_command_with_path_if_its_given(self):
1105 self.repo.run_git_command = mock.Mock(return_value=['', ''])
1106 self.repo.get_diff(self.repo[0], self.repo[1], 'foo')
1107 self.repo.run_git_command.assert_called_once_with(
1108 ['diff', '-U3', '--full-index', '--binary', '-p', '-M',
1109 '--abbrev=40', self.repo._lookup_commit(0),
1110 self.repo._lookup_commit(1), '--', 'foo'])
1111
1116
1112
1117
1113 @pytest.mark.usefixtures("vcs_repository_support")
1118 @pytest.mark.usefixtures("vcs_repository_support")
General Comments 0
You need to be logged in to leave comments. Login now