A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

test_test.py 790 B

1234567891011121314151617181920212223242526272829
  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)