From: Neil Date: Sat, 17 Nov 2012 15:44:20 +0000 (+0200) Subject: pep8 & pyflakes testirker. Add extra test case X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=fbf251de0ad945d3b25bcd991af64f6836d3ece1;p=bzrirker.git pep8 & pyflakes testirker. Add extra test case --- diff --git a/tests/testirker.py b/tests/testirker.py index 765e19d..059f6bd 100644 --- a/tests/testirker.py +++ b/tests/testirker.py @@ -6,7 +6,6 @@ from unittest import TestLoader from bzrlib import ( config, - tests, ) from bzrlib.bzrdir import BzrDir from bzrlib.tests import TestCaseInTempDir @@ -16,11 +15,14 @@ from bzrlib.plugins.bzrirker.irkerhook import IrkerSender def test_suite(): return TestLoader().loadTestsFromName(__name__) -sample_config=("[DEFAULT]\n" +sample_config = ("[DEFAULT]\n" "irker_project=bzrirker\n" "irker_channels=irc://chat.example.test/commits\n") -colour_config=("[DEFAULT]\n" +no_project_config = ("[DEFAULT]\n" + "irker_channels=irc://chat.example.test/commits\n") + +colour_config = ("[DEFAULT]\n" "irker_project=bzrirker\n" "irker_colours=mIRC\n" "irker_channels=irc://chat.example.test/commits\n") @@ -49,13 +51,19 @@ class TestConfigured(TestCaseInTempDir): 'bzrirker: Sample work * 1 / : foo bar ', irker._format()) + def test_no_project(self): + irker = self.get_irker(no_project_config) + self.assertEqual( + 'No Project name set: Sample ' + ' work * 1 / : foo bar ', + irker._format()) + def test_message_colour(self): irker = self.get_irker(colour_config) self.assertEqual( '\x02bzrirker:\x0f \x0303Sample \x0f' ' work * \x021\x0f / \x02\x0f: foo bar ', irker._format()) - def get_irker(self, text=sample_config): my_config = config.MemoryStack(text) self.branch = BzrDir.create_branch_convenience('.') @@ -70,5 +78,3 @@ class TestConfigured(TestCaseInTempDir): # We're not calling send, so do the setup stuff here irker._setup_revision_and_revno() return irker - -