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.

30 lines
790 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. def _test():
  15. self.command.process(self.make_msg("test"))
  16. self.assertSaidIn(["Hey \x02Foo\x0F!", "'sup \x02Foo\x0F?"])
  17. for i in xrange(64):
  18. _test()
  19. if __name__ == "__main__":
  20. unittest.main(verbosity=2)