A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
784 B

  1. # -*- coding: utf-8 -*-
  2. import unittest
  3. import support
  4. from commands.test import Command
  5. class TestTest(support.CommandTestCase):
  6. def setUp(self):
  7. super(TestTest, self).setUp(Command)
  8. def test_check(self):
  9. self.assertFalse(self.command.check(self.make_msg("bloop")))
  10. self.assertFalse(self.command.check(self.make_join()))
  11. self.assertTrue(self.command.check(self.make_msg("test")))
  12. self.assertTrue(self.command.check(self.make_msg("TEST", "foo")))
  13. def test_process(self):
  14. self.command.process(self.make_msg("test"))
  15. msgs = ["PRIVMSG #channel :Hey \x02Foo\x0F!",
  16. "PRIVMSG #channel :'sup \x02Foo\x0F?"]
  17. self.assertSentIn(msgs)
  18. if __name__ == "__main__":
  19. unittest.main(verbosity=2)