##// END OF EJS Templates
tests: fixed author for commit messages to be in a proper format.
marcink -
r3840:eb39c224 default
parent child Browse files
Show More
@@ -871,6 +871,7 b' class TestPullrequestsView(object):'
871 {'message': 'new-feature', 'branch': branch_name},
871 {'message': 'new-feature', 'branch': branch_name},
872 ]
872 ]
873 repo = backend_git.create_repo(commits)
873 repo = backend_git.create_repo(commits)
874 repo_name = repo.repo_name
874 commit_ids = backend_git.commit_ids
875 commit_ids = backend_git.commit_ids
875
876
876 pull_request = PullRequest()
877 pull_request = PullRequest()
@@ -888,13 +889,15 b' class TestPullrequestsView(object):'
888 Session().add(pull_request)
889 Session().add(pull_request)
889 Session().commit()
890 Session().commit()
890
891
892 pull_request_id = pull_request.pull_request_id
893
891 vcs = repo.scm_instance()
894 vcs = repo.scm_instance()
892 vcs.remove_ref('refs/heads/{}'.format(branch_name))
895 vcs.remove_ref('refs/heads/{}'.format(branch_name))
893
896
894 response = self.app.get(route_path(
897 response = self.app.get(route_path(
895 'pullrequest_show',
898 'pullrequest_show',
896 repo_name=repo.repo_name,
899 repo_name=repo_name,
897 pull_request_id=pull_request.pull_request_id))
900 pull_request_id=pull_request_id))
898
901
899 assert response.status_int == 200
902 assert response.status_int == 200
900
903
@@ -834,7 +834,7 b' class VcsBackend(object):'
834 imc.add(FileNode(filename, content=content))
834 imc.add(FileNode(filename, content=content))
835 imc.commit(
835 imc.commit(
836 message=u'Automatic commit from vcsbackend fixture',
836 message=u'Automatic commit from vcsbackend fixture',
837 author=u'Automatic')
837 author=u'Automatic <automatic@rhodecode.com>')
838
838
839 def ensure_file(self, filename, content='Test content\n'):
839 def ensure_file(self, filename, content='Test content\n'):
840 assert self._cleanup_repos, "Avoid writing into vcs_test repos"
840 assert self._cleanup_repos, "Avoid writing into vcs_test repos"
@@ -869,7 +869,7 b' def _add_commits_to_repo(vcs_repo, commi'
869
869
870 commit = imc.commit(
870 commit = imc.commit(
871 message=message,
871 message=message,
872 author=unicode(commit.get('author', 'Automatic')),
872 author=unicode(commit.get('author', 'Automatic <automatic@rhodecode.com>')),
873 date=commit.get('date'),
873 date=commit.get('date'),
874 branch=commit.get('branch'),
874 branch=commit.get('branch'),
875 parents=parents)
875 parents=parents)
@@ -425,13 +425,13 b' def commit_change('
425 message=message,
425 message=message,
426 nodes=nodes,
426 nodes=nodes,
427 parent_commit=_commit,
427 parent_commit=_commit,
428 author=TEST_USER_ADMIN_LOGIN,
428 author='{} <admin@rhodecode.com>'.format(TEST_USER_ADMIN_LOGIN),
429 )
429 )
430 else:
430 else:
431 commit = ScmModel().commit_change(
431 commit = ScmModel().commit_change(
432 repo=repo.scm_instance(), repo_name=repo.repo_name,
432 repo=repo.scm_instance(), repo_name=repo.repo_name,
433 commit=parent, user=TEST_USER_ADMIN_LOGIN,
433 commit=parent, user=TEST_USER_ADMIN_LOGIN,
434 author=TEST_USER_ADMIN_LOGIN,
434 author='{} <admin@rhodecode.com>'.format(TEST_USER_ADMIN_LOGIN),
435 message=message,
435 message=message,
436 content=content,
436 content=content,
437 f_path=filename
437 f_path=filename
@@ -59,7 +59,7 b' class TestBranches(BackendTestMixin):'
59 content='Documentation\n'))
59 content='Documentation\n'))
60 foobar_tip = self.imc.commit(
60 foobar_tip = self.imc.commit(
61 message=u'New branch: foobar',
61 message=u'New branch: foobar',
62 author=u'joe',
62 author=u'joe <joe@rhodecode.com>',
63 branch='foobar',
63 branch='foobar',
64 )
64 )
65 assert 'foobar' in self.repo.branches
65 assert 'foobar' in self.repo.branches
@@ -73,7 +73,7 b' class TestBranches(BackendTestMixin):'
73 content='Documentation\n'))
73 content='Documentation\n'))
74 foobar_tip = self.imc.commit(
74 foobar_tip = self.imc.commit(
75 message=u'New branch: foobar',
75 message=u'New branch: foobar',
76 author=u'joe',
76 author=u'joe <joe@rhodecode.com>',
77 branch='foobar',
77 branch='foobar',
78 parents=[tip],
78 parents=[tip],
79 )
79 )
@@ -82,14 +82,14 b' class TestBranches(BackendTestMixin):'
82 content='Documentation\nand more...\n'))
82 content='Documentation\nand more...\n'))
83 newtip = self.imc.commit(
83 newtip = self.imc.commit(
84 message=u'At default branch',
84 message=u'At default branch',
85 author=u'joe',
85 author=u'joe <joe@rhodecode.com>',
86 branch=foobar_tip.branch,
86 branch=foobar_tip.branch,
87 parents=[foobar_tip],
87 parents=[foobar_tip],
88 )
88 )
89
89
90 newest_tip = self.imc.commit(
90 newest_tip = self.imc.commit(
91 message=u'Merged with %s' % foobar_tip.raw_id,
91 message=u'Merged with %s' % foobar_tip.raw_id,
92 author=u'joe',
92 author=u'joe <joe@rhodecode.com>',
93 branch=self.backend_class.DEFAULT_BRANCH_NAME,
93 branch=self.backend_class.DEFAULT_BRANCH_NAME,
94 parents=[newtip, foobar_tip],
94 parents=[newtip, foobar_tip],
95 )
95 )
@@ -101,7 +101,7 b' class TestBranches(BackendTestMixin):'
101 def test_branch_with_slash_in_name(self):
101 def test_branch_with_slash_in_name(self):
102 self.imc.add(FileNode('extrafile', content='Some data\n'))
102 self.imc.add(FileNode('extrafile', content='Some data\n'))
103 self.imc.commit(
103 self.imc.commit(
104 u'Branch with a slash!', author=u'joe',
104 u'Branch with a slash!', author=u'joe <joe@rhodecode.com>',
105 branch='issue/123')
105 branch='issue/123')
106 assert 'issue/123' in self.repo.branches
106 assert 'issue/123' in self.repo.branches
107
107
@@ -109,11 +109,11 b' class TestBranches(BackendTestMixin):'
109 def test_branch_with_slash_in_name_and_similar_without(self):
109 def test_branch_with_slash_in_name_and_similar_without(self):
110 self.imc.add(FileNode('extrafile', content='Some data\n'))
110 self.imc.add(FileNode('extrafile', content='Some data\n'))
111 self.imc.commit(
111 self.imc.commit(
112 u'Branch with a slash!', author=u'joe',
112 u'Branch with a slash!', author=u'joe <joe@rhodecode.com>',
113 branch='issue/123')
113 branch='issue/123')
114 self.imc.add(FileNode('extrafile II', content='Some data\n'))
114 self.imc.add(FileNode('extrafile II', content='Some data\n'))
115 self.imc.commit(
115 self.imc.commit(
116 u'Branch without a slash...', author=u'joe',
116 u'Branch without a slash...', author=u'joe <joe@rhodecode.com>',
117 branch='123')
117 branch='123')
118 assert 'issue/123' in self.repo.branches
118 assert 'issue/123' in self.repo.branches
119 assert '123' in self.repo.branches
119 assert '123' in self.repo.branches
@@ -76,7 +76,7 b' class TestCommitsInNonEmptyRepo(BackendT'
76 content='Documentation\n'))
76 content='Documentation\n'))
77 foobar_tip = self.imc.commit(
77 foobar_tip = self.imc.commit(
78 message=u'New branch: foobar',
78 message=u'New branch: foobar',
79 author=u'joe',
79 author=u'joe <joe@rhodecode.com>',
80 branch='foobar',
80 branch='foobar',
81 )
81 )
82 assert 'foobar' in self.repo.branches
82 assert 'foobar' in self.repo.branches
@@ -92,7 +92,7 b' class TestCommitsInNonEmptyRepo(BackendT'
92 content='Documentation\n'))
92 content='Documentation\n'))
93 foobar_tip = self.imc.commit(
93 foobar_tip = self.imc.commit(
94 message=u'New branch: foobar',
94 message=u'New branch: foobar',
95 author=u'joe',
95 author=u'joe <joe@rhodecode.com>',
96 branch='foobar',
96 branch='foobar',
97 parents=[tip],
97 parents=[tip],
98 )
98 )
@@ -100,14 +100,14 b' class TestCommitsInNonEmptyRepo(BackendT'
100 content='Documentation\nand more...\n'))
100 content='Documentation\nand more...\n'))
101 newtip = self.imc.commit(
101 newtip = self.imc.commit(
102 message=u'At default branch',
102 message=u'At default branch',
103 author=u'joe',
103 author=u'joe <joe@rhodecode.com>',
104 branch=foobar_tip.branch,
104 branch=foobar_tip.branch,
105 parents=[foobar_tip],
105 parents=[foobar_tip],
106 )
106 )
107
107
108 newest_tip = self.imc.commit(
108 newest_tip = self.imc.commit(
109 message=u'Merged with %s' % foobar_tip.raw_id,
109 message=u'Merged with %s' % foobar_tip.raw_id,
110 author=u'joe',
110 author=u'joe <joe@rhodecode.com>',
111 branch=self.backend_class.DEFAULT_BRANCH_NAME,
111 branch=self.backend_class.DEFAULT_BRANCH_NAME,
112 parents=[newtip, foobar_tip],
112 parents=[newtip, foobar_tip],
113 )
113 )
@@ -134,28 +134,28 b' class TestCommitsInNonEmptyRepo(BackendT'
134 self.imc.add(FileNode('readme.txt', content='Document\n'))
134 self.imc.add(FileNode('readme.txt', content='Document\n'))
135 initial = self.imc.commit(
135 initial = self.imc.commit(
136 message=u'Initial commit',
136 message=u'Initial commit',
137 author=u'joe',
137 author=u'joe <joe@rhodecode.com>',
138 parents=[org_tip],
138 parents=[org_tip],
139 branch=DEFAULT_BRANCH,)
139 branch=DEFAULT_BRANCH,)
140
140
141 self.imc.add(FileNode('newdoc.txt', content='foobar\n'))
141 self.imc.add(FileNode('newdoc.txt', content='foobar\n'))
142 docs_branch_commit1 = self.imc.commit(
142 docs_branch_commit1 = self.imc.commit(
143 message=u'New branch: docs',
143 message=u'New branch: docs',
144 author=u'joe',
144 author=u'joe <joe@rhodecode.com>',
145 parents=[initial],
145 parents=[initial],
146 branch=TEST_BRANCH,)
146 branch=TEST_BRANCH,)
147
147
148 self.imc.add(FileNode('newdoc2.txt', content='foobar2\n'))
148 self.imc.add(FileNode('newdoc2.txt', content='foobar2\n'))
149 docs_branch_commit2 = self.imc.commit(
149 docs_branch_commit2 = self.imc.commit(
150 message=u'New branch: docs2',
150 message=u'New branch: docs2',
151 author=u'joe',
151 author=u'joe <joe@rhodecode.com>',
152 parents=[docs_branch_commit1],
152 parents=[docs_branch_commit1],
153 branch=TEST_BRANCH,)
153 branch=TEST_BRANCH,)
154
154
155 self.imc.add(FileNode('newfile', content='hello world\n'))
155 self.imc.add(FileNode('newfile', content='hello world\n'))
156 self.imc.commit(
156 self.imc.commit(
157 message=u'Back in default branch',
157 message=u'Back in default branch',
158 author=u'joe',
158 author=u'joe <joe@rhodecode.com>',
159 parents=[initial],
159 parents=[initial],
160 branch=DEFAULT_BRANCH,)
160 branch=DEFAULT_BRANCH,)
161
161
@@ -586,7 +586,7 b' TODO: To be written...'
586 imc.add(FileNode('file_x', content=source_repo.name))
586 imc.add(FileNode('file_x', content=source_repo.name))
587 imc.commit(
587 imc.commit(
588 message=u'Automatic commit from repo merge test',
588 message=u'Automatic commit from repo merge test',
589 author=u'Automatic')
589 author=u'Automatic <automatic@rhodecode.com>')
590 target_commit = target_repo.get_commit()
590 target_commit = target_repo.get_commit()
591 source_commit = source_repo.get_commit()
591 source_commit = source_repo.get_commit()
592 default_branch = target_repo.DEFAULT_BRANCH_NAME
592 default_branch = target_repo.DEFAULT_BRANCH_NAME
@@ -630,7 +630,7 b' TODO: To be written...'
630 imc.add(FileNode('file_x', content=source_repo.name))
630 imc.add(FileNode('file_x', content=source_repo.name))
631 imc.commit(
631 imc.commit(
632 message=u'Automatic commit from repo merge test',
632 message=u'Automatic commit from repo merge test',
633 author=u'Automatic')
633 author=u'Automatic <automatic@rhodecode.com>')
634 target_commit = target_repo.get_commit()
634 target_commit = target_repo.get_commit()
635 source_commit = source_repo.get_commit()
635 source_commit = source_repo.get_commit()
636 default_branch = target_repo.DEFAULT_BRANCH_NAME
636 default_branch = target_repo.DEFAULT_BRANCH_NAME
@@ -669,7 +669,7 b' TODO: To be written...'
669 commits = list(target_repo.get_commits())
669 commits = list(target_repo.get_commits())
670 imc.commit(
670 imc.commit(
671 message=u'Automatic commit from repo merge test',
671 message=u'Automatic commit from repo merge test',
672 author=u'Automatic', parents=commits[0:1])
672 author=u'Automatic <automatic@rhodecode.com>', parents=commits[0:1])
673
673
674 target_commit = target_repo.get_commit()
674 target_commit = target_repo.get_commit()
675 source_commit = source_repo.get_commit()
675 source_commit = source_repo.get_commit()
@@ -702,7 +702,7 b' TODO: To be written...'
702 imc.add(FileNode('file_x', content=source_repo.name))
702 imc.add(FileNode('file_x', content=source_repo.name))
703 imc.commit(
703 imc.commit(
704 message=u'Automatic commit from repo merge test',
704 message=u'Automatic commit from repo merge test',
705 author=u'Automatic')
705 author=u'Automatic <automatic@rhodecode.com>')
706 target_commit = target_repo.get_commit()
706 target_commit = target_repo.get_commit()
707 source_commit = source_repo.get_commit()
707 source_commit = source_repo.get_commit()
708
708
@@ -116,7 +116,7 b' class TestInMemoryCommit(BackendTestMixi'
116 def commit(self, branch=None):
116 def commit(self, branch=None):
117 self.old_commit_count = len(self.repo.commit_ids)
117 self.old_commit_count = len(self.repo.commit_ids)
118 self.commit_message = u'Test commit with unicode: ΕΌΓ³Ε‚wik'
118 self.commit_message = u'Test commit with unicode: ΕΌΓ³Ε‚wik'
119 self.commit_author = unicode(self.__class__)
119 self.commit_author = u'{} <foo@email.com>'.format(self.__class__.__name__)
120 self.commit = self.imc.commit(
120 self.commit = self.imc.commit(
121 message=self.commit_message, author=self.commit_author,
121 message=self.commit_message, author=self.commit_author,
122 branch=branch)
122 branch=branch)
@@ -127,7 +127,7 b' class TestInMemoryCommit(BackendTestMixi'
127 FileNode('foo/README.txt', content='readme!'),
127 FileNode('foo/README.txt', content='readme!'),
128 ]
128 ]
129 self.imc.add(*to_add)
129 self.imc.add(*to_add)
130 commit = self.imc.commit(u'Initial', u'joe.doe@example.com')
130 commit = self.imc.commit(u'Initial', u'joe doe <joe.doe@example.com>')
131 assert isinstance(commit.get_node('foo'), DirNode)
131 assert isinstance(commit.get_node('foo'), DirNode)
132 assert isinstance(commit.get_node('foo/bar'), DirNode)
132 assert isinstance(commit.get_node('foo/bar'), DirNode)
133 self.assert_nodes_in_commit(commit, to_add)
133 self.assert_nodes_in_commit(commit, to_add)
@@ -141,7 +141,7 b' class TestInMemoryCommit(BackendTestMixi'
141 FileNode('foobar/barbaz', content='foo'),
141 FileNode('foobar/barbaz', content='foo'),
142 ]
142 ]
143 self.imc.add(*to_add)
143 self.imc.add(*to_add)
144 commit = self.imc.commit(u'Another', u'joe.doe@example.com')
144 commit = self.imc.commit(u'Another', u'joe doe <joe.doe@example.com>')
145 self.assert_nodes_in_commit(commit, to_add)
145 self.assert_nodes_in_commit(commit, to_add)
146
146
147 def test_add_raise_already_added(self):
147 def test_add_raise_already_added(self):
@@ -153,20 +153,20 b' class TestInMemoryCommit(BackendTestMixi'
153 def test_check_integrity_raise_already_exist(self):
153 def test_check_integrity_raise_already_exist(self):
154 node = FileNode('foobar', content='baz')
154 node = FileNode('foobar', content='baz')
155 self.imc.add(node)
155 self.imc.add(node)
156 self.imc.commit(message=u'Added foobar', author=unicode(self))
156 self.imc.commit(message=u'Added foobar', author=u'{} <foo@bar.com>'.format(self))
157 self.imc.add(node)
157 self.imc.add(node)
158 with pytest.raises(NodeAlreadyExistsError):
158 with pytest.raises(NodeAlreadyExistsError):
159 self.imc.commit(message='new message', author=str(self))
159 self.imc.commit(message='new message', author=u'{} <foo@bar.com>'.format(self))
160
160
161 def test_change(self):
161 def test_change(self):
162 self.imc.add(FileNode('foo/bar/baz', content='foo'))
162 self.imc.add(FileNode('foo/bar/baz', content='foo'))
163 self.imc.add(FileNode('foo/fbar', content='foobar'))
163 self.imc.add(FileNode('foo/fbar', content='foobar'))
164 tip = self.imc.commit(u'Initial', u'joe.doe@example.com')
164 tip = self.imc.commit(u'Initial', u'joe doe <joe.doe@example.com>')
165
165
166 # Change node's content
166 # Change node's content
167 node = FileNode('foo/bar/baz', content='My **changed** content')
167 node = FileNode('foo/bar/baz', content='My **changed** content')
168 self.imc.change(node)
168 self.imc.change(node)
169 self.imc.commit(u'Changed %s' % node.path, u'joe.doe@example.com')
169 self.imc.commit(u'Changed %s' % node.path, u'joe doe <joe.doe@example.com>')
170
170
171 newtip = self.repo.get_commit()
171 newtip = self.repo.get_commit()
172 assert tip != newtip
172 assert tip != newtip
@@ -181,19 +181,19 b' class TestInMemoryCommit(BackendTestMixi'
181 for node in to_add:
181 for node in to_add:
182 self.imc.add(node)
182 self.imc.add(node)
183
183
184 tip = self.imc.commit(u'Initial', u'joe.doe@example.com')
184 tip = self.imc.commit(u'Initial', u'joe doe <joe.doe@example.com>')
185
185
186 # Change node's content
186 # Change node's content
187 node = FileNode('ΕΌΓ³Ε‚wik/zwierzΔ…tko', content='My **changed** content')
187 node = FileNode('ΕΌΓ³Ε‚wik/zwierzΔ…tko', content='My **changed** content')
188 self.imc.change(node)
188 self.imc.change(node)
189 self.imc.commit(u'Changed %s' % safe_unicode(node.path),
189 self.imc.commit(u'Changed %s' % safe_unicode(node.path),
190 u'joe.doe@example.com')
190 author=u'joe doe <joe.doe@example.com>')
191
191
192 node_uni = FileNode(
192 node_uni = FileNode(
193 u'ΕΌΓ³Ε‚wik/zwierzΔ…tko_uni', content=u'My **changed** content')
193 u'ΕΌΓ³Ε‚wik/zwierzΔ…tko_uni', content=u'My **changed** content')
194 self.imc.change(node_uni)
194 self.imc.change(node_uni)
195 self.imc.commit(u'Changed %s' % safe_unicode(node_uni.path),
195 self.imc.commit(u'Changed %s' % safe_unicode(node_uni.path),
196 u'joe.doe@example.com')
196 author=u'joe doe <joe.doe@example.com>')
197
197
198 newtip = self.repo.get_commit()
198 newtip = self.repo.get_commit()
199 assert tip != newtip
199 assert tip != newtip
@@ -209,18 +209,16 b' class TestInMemoryCommit(BackendTestMixi'
209 def test_check_integrity_change_raise_node_does_not_exist(self):
209 def test_check_integrity_change_raise_node_does_not_exist(self):
210 node = FileNode('foobar', content='baz')
210 node = FileNode('foobar', content='baz')
211 self.imc.add(node)
211 self.imc.add(node)
212 self.imc.commit(message=u'Added foobar', author=unicode(self))
212 self.imc.commit(message=u'Added foobar', author=u'{} <foo@bar.com>'.format(self))
213 node = FileNode('not-foobar', content='')
213 node = FileNode('not-foobar', content='')
214 self.imc.change(node)
214 self.imc.change(node)
215 with pytest.raises(NodeDoesNotExistError):
215 with pytest.raises(NodeDoesNotExistError):
216 self.imc.commit(
216 self.imc.commit(message='Changed not existing node', author=u'{} <foo@bar.com>'.format(self))
217 message='Changed not existing node',
218 author=str(self))
219
217
220 def test_change_raise_node_already_changed(self):
218 def test_change_raise_node_already_changed(self):
221 node = FileNode('foobar', content='baz')
219 node = FileNode('foobar', content='baz')
222 self.imc.add(node)
220 self.imc.add(node)
223 self.imc.commit(message=u'Added foobar', author=unicode(self))
221 self.imc.commit(message=u'Added foobar', author=u'{} <foo@bar.com>'.format(self))
224 node = FileNode('foobar', content='more baz')
222 node = FileNode('foobar', content='more baz')
225 self.imc.change(node)
223 self.imc.change(node)
226 with pytest.raises(NodeAlreadyChangedError):
224 with pytest.raises(NodeAlreadyChangedError):
@@ -234,12 +232,12 b' class TestInMemoryCommit(BackendTestMixi'
234 with pytest.raises(NodeNotChangedError):
232 with pytest.raises(NodeNotChangedError):
235 self.imc.commit(
233 self.imc.commit(
236 message=u'Trying to mark node as changed without touching it',
234 message=u'Trying to mark node as changed without touching it',
237 author=unicode(self))
235 author=u'{} <foo@bar.com>'.format(self))
238
236
239 def test_change_raise_node_already_removed(self):
237 def test_change_raise_node_already_removed(self):
240 node = FileNode('foobar', content='baz')
238 node = FileNode('foobar', content='baz')
241 self.imc.add(node)
239 self.imc.add(node)
242 self.imc.commit(message=u'Added foobar', author=unicode(self))
240 self.imc.commit(message=u'Added foobar', author=u'{} <foo@bar.com>'.format(self))
243 self.imc.remove(FileNode('foobar'))
241 self.imc.remove(FileNode('foobar'))
244 with pytest.raises(NodeAlreadyRemovedError):
242 with pytest.raises(NodeAlreadyRemovedError):
245 self.imc.change(node)
243 self.imc.change(node)
@@ -252,7 +250,7 b' class TestInMemoryCommit(BackendTestMixi'
252 assert node.content == tip.get_node(node.path).content
250 assert node.content == tip.get_node(node.path).content
253 self.imc.remove(node)
251 self.imc.remove(node)
254 self.imc.commit(
252 self.imc.commit(
255 message=u'Removed %s' % node.path, author=unicode(self))
253 message=u'Removed %s' % node.path, author=u'{} <foo@bar.com>'.format(self))
256
254
257 newtip = self.repo.get_commit()
255 newtip = self.repo.get_commit()
258 assert tip != newtip
256 assert tip != newtip
@@ -263,10 +261,10 b' class TestInMemoryCommit(BackendTestMixi'
263 def test_remove_last_file_from_directory(self):
261 def test_remove_last_file_from_directory(self):
264 node = FileNode('omg/qwe/foo/bar', content='foobar')
262 node = FileNode('omg/qwe/foo/bar', content='foobar')
265 self.imc.add(node)
263 self.imc.add(node)
266 self.imc.commit(u'added', u'joe doe')
264 self.imc.commit(u'added', author=u'joe doe <joe@doe.com>')
267
265
268 self.imc.remove(node)
266 self.imc.remove(node)
269 tip = self.imc.commit(u'removed', u'joe doe')
267 tip = self.imc.commit(u'removed', u'joe doe <joe@doe.com>')
270 with pytest.raises(NodeDoesNotExistError):
268 with pytest.raises(NodeDoesNotExistError):
271 tip.get_node('omg/qwe/foo/bar')
269 tip.get_node('omg/qwe/foo/bar')
272
270
@@ -275,7 +273,7 b' class TestInMemoryCommit(BackendTestMixi'
275 with pytest.raises(NodeDoesNotExistError):
273 with pytest.raises(NodeDoesNotExistError):
276 self.imc.commit(
274 self.imc.commit(
277 message='Trying to remove node at empty repository',
275 message='Trying to remove node at empty repository',
278 author=str(self))
276 author=u'{} <foo@bar.com>'.format(self))
279
277
280 def test_check_integrity_remove_raise_node_does_not_exist(self, nodes):
278 def test_check_integrity_remove_raise_node_does_not_exist(self, nodes):
281 self.test_add(nodes) # Performs first commit
279 self.test_add(nodes) # Performs first commit
@@ -285,7 +283,7 b' class TestInMemoryCommit(BackendTestMixi'
285 with pytest.raises(NodeDoesNotExistError):
283 with pytest.raises(NodeDoesNotExistError):
286 self.imc.commit(
284 self.imc.commit(
287 message=u'Trying to remove not existing node',
285 message=u'Trying to remove not existing node',
288 author=unicode(self))
286 author=u'{} <foo@bar.com>'.format(self))
289
287
290 def test_remove_raise_node_already_removed(self, nodes):
288 def test_remove_raise_node_already_removed(self, nodes):
291 self.test_add(nodes) # Performs first commit
289 self.test_add(nodes) # Performs first commit
@@ -318,7 +316,7 b' class TestInMemoryCommit(BackendTestMixi'
318 content = 'foobar\n' * x
316 content = 'foobar\n' * x
319 node = FileNode(fname, content=content)
317 node = FileNode(fname, content=content)
320 self.imc.add(node)
318 self.imc.add(node)
321 commit = self.imc.commit(u"Commit no. %s" % (x + 1), author=u'vcs')
319 commit = self.imc.commit(u"Commit no. %s" % (x + 1), author=u'vcs <foo@bar.com>')
322 assert last != commit
320 assert last != commit
323 last = commit
321 last = commit
324
322
@@ -335,7 +333,7 b' class TestInMemoryCommit(BackendTestMixi'
335 date = datetime.datetime(1985, 1, 30, 1, 45)
333 date = datetime.datetime(1985, 1, 30, 1, 45)
336 commit = self.imc.commit(
334 commit = self.imc.commit(
337 u"Committed at time when I was born ;-)",
335 u"Committed at time when I was born ;-)",
338 author=u'lb', date=date)
336 author=u'{} <foo@bar.com>'.format(self), date=date)
339
337
340 assert commit.date == local_dt_to_utc(date)
338 assert commit.date == local_dt_to_utc(date)
341
339
@@ -279,7 +279,7 b' class TestRepositoryMerge(object):'
279 imc.add(FileNode('file_x', content=self.source_repo.name))
279 imc.add(FileNode('file_x', content=self.source_repo.name))
280 imc.commit(
280 imc.commit(
281 message=u'Automatic commit from repo merge test',
281 message=u'Automatic commit from repo merge test',
282 author=u'Automatic')
282 author=u'Automatic <automatic@rhodecode.com>')
283 self.target_commit = self.target_repo.get_commit()
283 self.target_commit = self.target_repo.get_commit()
284 self.source_commit = self.source_repo.get_commit()
284 self.source_commit = self.source_repo.get_commit()
285 # This only works for Git and Mercurial
285 # This only works for Git and Mercurial
@@ -58,7 +58,7 b' def test_git_push_with_small_push_buffer'
58 repo.in_memory_commit.add(FileNode('readme.md', content='## Hello'))
58 repo.in_memory_commit.add(FileNode('readme.md', content='## Hello'))
59 repo.in_memory_commit.commit(
59 repo.in_memory_commit.commit(
60 message='Commit on branch Master',
60 message='Commit on branch Master',
61 author='Automatic test',
61 author='Automatic test <automatic@rhodecode.com>',
62 branch='master')
62 branch='master')
63
63
64 repo_cmd = Command(repo.path)
64 repo_cmd = Command(repo.path)
@@ -50,7 +50,7 b' class TestVCSOperationsSpecial(object):'
50 repo.in_memory_commit.add(FileNode('file', content=''))
50 repo.in_memory_commit.add(FileNode('file', content=''))
51 repo.in_memory_commit.commit(
51 repo.in_memory_commit.commit(
52 message='Commit on branch test',
52 message='Commit on branch test',
53 author='Automatic test',
53 author='Automatic test <automatic@rhodecode.com>',
54 branch='test')
54 branch='test')
55
55
56 repo_cmd = Command(repo.path)
56 repo_cmd = Command(repo.path)
@@ -92,7 +92,7 b' class TestVCSOperationsSpecial(object):'
92 repo.in_memory_commit.add(FileNode('readme.md', content='## Hello'))
92 repo.in_memory_commit.add(FileNode('readme.md', content='## Hello'))
93 repo.in_memory_commit.commit(
93 repo.in_memory_commit.commit(
94 message='Commit on branch Master',
94 message='Commit on branch Master',
95 author='Automatic test',
95 author='Automatic test <automatic@rhodecode.com>',
96 branch='master')
96 branch='master')
97
97
98 repo_cmd = Command(repo.path)
98 repo_cmd = Command(repo.path)
@@ -109,7 +109,7 b' class TestVCSOperationsSpecial(object):'
109 repo.in_memory_commit.add(FileNode('setup.py', content='print\n'))
109 repo.in_memory_commit.add(FileNode('setup.py', content='print\n'))
110 repo.in_memory_commit.commit(
110 repo.in_memory_commit.commit(
111 message='Commit2 on branch Master',
111 message='Commit2 on branch Master',
112 author='Automatic test2',
112 author='Automatic test2 <automatic@rhodecode.com>',
113 branch='master')
113 branch='master')
114
114
115 repo_cmd = Command(repo.path)
115 repo_cmd = Command(repo.path)
@@ -124,7 +124,7 b' class TestVCSOperationsSpecial(object):'
124 repo.in_memory_commit.add(FileNode('feature1.py', content='## Hello world'))
124 repo.in_memory_commit.add(FileNode('feature1.py', content='## Hello world'))
125 repo.in_memory_commit.commit(
125 repo.in_memory_commit.commit(
126 message='Commit on branch feature',
126 message='Commit on branch feature',
127 author='Automatic test',
127 author='Automatic test <automatic@rhodecode.com>',
128 branch='feature')
128 branch='feature')
129
129
130 repo_cmd = Command(repo.path)
130 repo_cmd = Command(repo.path)
General Comments 0
You need to be logged in to leave comments. Login now