Mercurial > bitten > bitten-test
comparison bitten/tests/web_ui.py @ 440:e660687ac89c
Follow-up fix to [486]: trailing chars in auto-linked log messages was getting removed.
author | cmlenz |
---|---|
date | Tue, 21 Aug 2007 11:23:56 +0000 |
parents | 20ddfbb8e879 |
children | c9ac97df8a5e |
comparison
equal
deleted
inserted
replaced
439:20ddfbb8e879 | 440:e660687ac89c |
---|---|
162 | 162 |
163 req = Mock(method='GET', href=Href('/trac'), authname='hal') | 163 req = Mock(method='GET', href=Href('/trac'), authname='hal') |
164 comp = SourceFileLinkFormatter(self.env) | 164 comp = SourceFileLinkFormatter(self.env) |
165 formatter = comp.get_formatter(req, build) | 165 formatter = comp.get_formatter(req, build) |
166 | 166 |
167 output = formatter(step, None, None, u'error in foo/bar.c') | 167 output = formatter(step, None, None, u'error in foo/bar.c: bad') |
168 self.assertEqual(Markup, type(output)) | 168 self.assertEqual(Markup, type(output)) |
169 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c">' | 169 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c">' |
170 'foo/bar.c</a>', output) | 170 'foo/bar.c</a>: bad', output) |
171 | 171 |
172 def test_format_simple_link_not_in_repos(self): | 172 def test_format_simple_link_not_in_repos(self): |
173 BuildConfig(self.env, name='test', path='trunk').insert() | 173 BuildConfig(self.env, name='test', path='trunk').insert() |
174 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | 174 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, |
175 status=Build.SUCCESS, slave='hal') | 175 status=Build.SUCCESS, slave='hal') |
184 | 184 |
185 req = Mock(method='GET', href=Href('/trac'), authname='hal') | 185 req = Mock(method='GET', href=Href('/trac'), authname='hal') |
186 comp = SourceFileLinkFormatter(self.env) | 186 comp = SourceFileLinkFormatter(self.env) |
187 formatter = comp.get_formatter(req, build) | 187 formatter = comp.get_formatter(req, build) |
188 | 188 |
189 output = formatter(step, None, None, u'error in foo/bar.c') | 189 output = formatter(step, None, None, u'error in foo/bar.c: bad') |
190 self.assertEqual(Markup, type(output)) | 190 self.assertEqual(Markup, type(output)) |
191 self.assertEqual('error in foo/bar.c', output) | 191 self.assertEqual('error in foo/bar.c: bad', output) |
192 | 192 |
193 def test_format_link_in_repos_with_line(self): | 193 def test_format_link_in_repos_with_line(self): |
194 BuildConfig(self.env, name='test', path='trunk').insert() | 194 BuildConfig(self.env, name='test', path='trunk').insert() |
195 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | 195 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, |
196 status=Build.SUCCESS, slave='hal') | 196 status=Build.SUCCESS, slave='hal') |
203 | 203 |
204 req = Mock(method='GET', href=Href('/trac'), authname='hal') | 204 req = Mock(method='GET', href=Href('/trac'), authname='hal') |
205 comp = SourceFileLinkFormatter(self.env) | 205 comp = SourceFileLinkFormatter(self.env) |
206 formatter = comp.get_formatter(req, build) | 206 formatter = comp.get_formatter(req, build) |
207 | 207 |
208 output = formatter(step, None, None, u'error in foo/bar.c:123') | 208 output = formatter(step, None, None, u'error in foo/bar.c:123: bad') |
209 self.assertEqual(Markup, type(output)) | 209 self.assertEqual(Markup, type(output)) |
210 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c#L123">' | 210 self.assertEqual('error in <a href="/trac/browser/trunk/foo/bar.c#L123">' |
211 'foo/bar.c:123</a>', output) | 211 'foo/bar.c:123</a>: bad', output) |
212 | 212 |
213 def test_format_link_not_in_repos_with_line(self): | 213 def test_format_link_not_in_repos_with_line(self): |
214 BuildConfig(self.env, name='test', path='trunk').insert() | 214 BuildConfig(self.env, name='test', path='trunk').insert() |
215 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, | 215 build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, |
216 status=Build.SUCCESS, slave='hal') | 216 status=Build.SUCCESS, slave='hal') |
225 | 225 |
226 req = Mock(method='GET', href=Href('/trac'), authname='hal') | 226 req = Mock(method='GET', href=Href('/trac'), authname='hal') |
227 comp = SourceFileLinkFormatter(self.env) | 227 comp = SourceFileLinkFormatter(self.env) |
228 formatter = comp.get_formatter(req, build) | 228 formatter = comp.get_formatter(req, build) |
229 | 229 |
230 output = formatter(step, None, None, u'error in foo/bar.c:123') | 230 output = formatter(step, None, None, u'error in foo/bar.c:123: bad') |
231 self.assertEqual(Markup, type(output)) | 231 self.assertEqual(Markup, type(output)) |
232 self.assertEqual('error in foo/bar.c:123', output) | 232 self.assertEqual('error in foo/bar.c:123: bad', output) |
233 | 233 |
234 | 234 |
235 def suite(): | 235 def suite(): |
236 suite = unittest.TestSuite() | 236 suite = unittest.TestSuite() |
237 suite.addTest(unittest.makeSuite(BuildConfigControllerTestCase, 'test')) | 237 suite.addTest(unittest.makeSuite(BuildConfigControllerTestCase, 'test')) |