Mercurial > hgsubversion
comparison tests/test_template_keywords.py @ 721:af817963897e
test_template_keywords: use new requiresmodule decorator
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 04 Oct 2010 23:03:28 -0500 |
parents | cb32d90f915e |
children | aa24148a7454 |
comparison
equal
deleted
inserted
replaced
720:a19a208c085b | 721:af817963897e |
---|---|
18 self._output = "" | 18 self._output = "" |
19 | 19 |
20 def write(self, msg, *args, **kwds): | 20 def write(self, msg, *args, **kwds): |
21 self._output += msg | 21 self._output += msg |
22 | 22 |
23 | |
23 class TestLogKeywords(test_util.TestBase): | 24 class TestLogKeywords(test_util.TestBase): |
24 if templatekw: | 25 @test_util.requiresmodule(templatekw) |
25 def test_svn_keywords(self): | 26 def test_svn_keywords(self): |
26 defaults = {'date': None, 'rev': None, 'user': None} | 27 defaults = {'date': None, 'rev': None, 'user': None} |
27 repo = self._load_fixture_and_fetch('two_revs.svndump') | 28 repo = self._load_fixture_and_fetch('two_revs.svndump') |
28 | 29 |
29 # we want one commit that isn't from Subversion | 30 # we want one commit that isn't from Subversion |
30 self.commitchanges([('foo', 'foo', 'frobnicate\n')]) | 31 self.commitchanges([('foo', 'foo', 'frobnicate\n')]) |
31 | 32 |
32 ui = CapturingUI() | 33 ui = CapturingUI() |
33 commands.log(ui, repo, template='{rev}:{svnrev} ', **defaults) | 34 commands.log(ui, repo, template='{rev}:{svnrev} ', **defaults) |
34 self.assertEqual(ui._output, '0:2 1:3 2: ') | 35 self.assertEqual(ui._output, '0:2 1:3 2: ') |
35 ui = CapturingUI() | 36 ui = CapturingUI() |
36 commands.log(ui, repo, template='{rev}:{svnpath} ', **defaults) | 37 commands.log(ui, repo, template='{rev}:{svnpath} ', **defaults) |
37 self.assertEqual(ui._output, '0:/trunk 1:/trunk 2: ') | 38 self.assertEqual(ui._output, '0:/trunk 1:/trunk 2: ') |
38 ui = CapturingUI() | 39 ui = CapturingUI() |
39 commands.log(ui, repo, template='{rev}:{svnuuid} ', **defaults) | 40 commands.log(ui, repo, template='{rev}:{svnuuid} ', **defaults) |
40 self.assertEqual(ui._output, | 41 self.assertEqual(ui._output, |
41 ('0:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' | 42 ('0:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' |
42 '1:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' | 43 '1:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' |
43 '2: ')) | 44 '2: ')) |
44 | 45 |
45 | 46 |
46 def suite(): | 47 def suite(): |
47 all = [unittest.TestLoader().loadTestsFromTestCase(TestLogKeywords),] | 48 all = [unittest.TestLoader().loadTestsFromTestCase(TestLogKeywords),] |
48 return unittest.TestSuite(all) | 49 return unittest.TestSuite(all) |