class TestShouldReply(unittest.TestCase): def setUp(self): self.replier = Replier(TestParser(), TEST_USER, TEST_PASS, TEST_SUB, TEST_USER_AGENT, TEST_LIMIT) self.bots_comment = CommentMock(TEST_USER, []) self.other_comment = CommentMock("Siegmeyer", ["Gwyn, Gwyndolin, Gwynevere"]) self.blacklist_comment = CommentMock("test_user", []) self.already_replied = CommentMock("Solaire", [TEST_USER, "Crestfallen", "Andre"]) def test_should_not_reply_to_self(self): self.replier._should_reply(self.bots_comment) self.assertFalse(self.replier._should_reply(self.bots_comment)) def test_should_not_reply_to_blacklist(self): self.assertFalse(self.replier._should_reply(self.blacklist_comment)) def test_should_not_reply_to_same_comment_twice(self): self.assertFalse(self.replier._should_reply(self.already_replied)) def test_should_reply_to_others(self): self.assertTrue(self.replier._should_reply(self.other_comment))
class TestShouldReply(unittest.TestCase): def setUp(self): self.replier = Replier(TestParser(), TEST_USER, TEST_PASS, TEST_SUB, TEST_USER_AGENT, TEST_LIMIT) self.bots_comment = CommentMock(TEST_USER, []) self.other_comment = CommentMock('Siegmeyer', ['Gwyn, Gwyndolin, Gwynevere']) self.blacklist_comment = CommentMock('test_user', []) self.already_replied = CommentMock('Solaire', [TEST_USER, 'Crestfallen', 'Andre']) def test_should_not_reply_to_self(self): self.replier._should_reply(self.bots_comment) self.assertFalse(self.replier._should_reply(self.bots_comment)) def test_should_not_reply_to_blacklist(self): self.assertFalse(self.replier._should_reply(self.blacklist_comment)) def test_should_not_reply_to_same_comment_twice(self): self.assertFalse(self.replier._should_reply(self.already_replied)) def test_should_reply_to_others(self): self.assertTrue(self.replier._should_reply(self.other_comment))