Mercurial > hgsubversion
diff 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 |
line wrap: on
line diff
--- a/tests/test_template_keywords.py +++ b/tests/test_template_keywords.py @@ -20,27 +20,28 @@ class CapturingUI(ui.ui): def write(self, msg, *args, **kwds): self._output += msg + class TestLogKeywords(test_util.TestBase): - if templatekw: - def test_svn_keywords(self): - defaults = {'date': None, 'rev': None, 'user': None} - repo = self._load_fixture_and_fetch('two_revs.svndump') - - # we want one commit that isn't from Subversion - self.commitchanges([('foo', 'foo', 'frobnicate\n')]) - - ui = CapturingUI() - commands.log(ui, repo, template='{rev}:{svnrev} ', **defaults) - self.assertEqual(ui._output, '0:2 1:3 2: ') - ui = CapturingUI() - commands.log(ui, repo, template='{rev}:{svnpath} ', **defaults) - self.assertEqual(ui._output, '0:/trunk 1:/trunk 2: ') - ui = CapturingUI() - commands.log(ui, repo, template='{rev}:{svnuuid} ', **defaults) - self.assertEqual(ui._output, - ('0:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' - '1:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' - '2: ')) + @test_util.requiresmodule(templatekw) + def test_svn_keywords(self): + defaults = {'date': None, 'rev': None, 'user': None} + repo = self._load_fixture_and_fetch('two_revs.svndump') + + # we want one commit that isn't from Subversion + self.commitchanges([('foo', 'foo', 'frobnicate\n')]) + + ui = CapturingUI() + commands.log(ui, repo, template='{rev}:{svnrev} ', **defaults) + self.assertEqual(ui._output, '0:2 1:3 2: ') + ui = CapturingUI() + commands.log(ui, repo, template='{rev}:{svnpath} ', **defaults) + self.assertEqual(ui._output, '0:/trunk 1:/trunk 2: ') + ui = CapturingUI() + commands.log(ui, repo, template='{rev}:{svnuuid} ', **defaults) + self.assertEqual(ui._output, + ('0:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' + '1:df2126f7-00ab-4d49-b42c-7e981dde0bcf ' + '2: ')) def suite():