from bzrlib import (
config,
- tests,
)
from bzrlib.bzrdir import BzrDir
from bzrlib.tests import TestCaseInTempDir
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")
'bzrirker: Sample <john@example.test> 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 <john@example.test>'
+ ' work * 1 / : foo bar ',
+ irker._format())
+
def test_message_colour(self):
irker = self.get_irker(colour_config)
self.assertEqual(
'\x02bzrirker:\x0f \x0303Sample <john@example.test>\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('.')
# We're not calling send, so do the setup stuff here
irker._setup_revision_and_revno()
return irker
-
-