From 3ad2374dac50ec7521ac40e40239edd9ea1dfe3a Mon Sep 17 00:00:00 2001 From: Shauna Date: Tue, 5 Aug 2014 12:26:11 -0400 Subject: [PATCH] Add join_IRC tests --- test_newbot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test_newbot.py b/test_newbot.py index 8bbe2c4..32f2cb1 100644 --- a/test_newbot.py +++ b/test_newbot.py @@ -100,6 +100,16 @@ class TestNewComerClass(unittest.TestCase): time.sleep(0.01) self.assertAlmostEqual(newComer.around_for(), .01, places=2) +class TestJoinIRC(unittest.TestCase): + + def setUp(self): + self.ircsock = fake_irc_start() + + def test_sent_messages(self): + newbot.join_irc(self.ircsock) + expected = ["USER WelcomeBot2 WelcomeBot2 WelcomeBot2 :This is http://openhatch.org/'s greeter bot.\n", 'NICK WelcomeBot2\n', 'JOIN #openhatch-bots \n'] + self.assertEqual(self.ircsock.sent_messages,expected) + class TestProcessNewcomers(unittest.TestCase): def setUp(self):