~ubuntu-branches/ubuntu/utopic/gozerbot/utopic

« back to all changes in this revision

Viewing changes to plugtests/test_code.py

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Malcolm
  • Date: 2009-09-14 09:00:29 UTC
  • mfrom: (1.1.4 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090914090029-uval0ekt72kmklxw
Tags: 0.9.1.3-3
Changed dependency on python-setuptools to python-pkg-resources
(Closes: #546435) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# tests/test_code.py
2
 
#
3
 
#
4
 
 
5
 
__copyright__ = 'this file is in the public domain'
6
 
 
7
 
from gozerbot.bot import Bot
8
 
from gozerbot.generic import stringinlist, waitforqueue
9
 
from gozerbot.plugins import plugins
10
 
import unittest, Queue
11
 
 
12
 
plugins.reload('gozerplugs.plugs', 'code')
13
 
plugins.reload('gozerplugs.plugs', 'googletalk')
14
 
 
15
 
class test_code(unittest.TestCase):
16
 
    b = Bot()
17
 
    b.userhosts['test'] = 'test@test'
18
 
 
19
 
    def test_funcnames(self):
20
 
        result = self.b.test('funcnames')
21
 
        self.assert_(stringinlist('<plugname>', result))
22
 
 
23
 
    def test_funcnames2(self):
24
 
        result = self.b.test('funcnames mekker')
25
 
        self.assert_(stringinlist('no mekker plugin exists', result))
26
 
 
27
 
    def test_funcnames3(self):
28
 
        result = self.b.test('funcnames code')
29
 
        self.assert_(stringinlist('handle_funcnames', result))
30
 
 
31
 
    def test_funcnames4(self):
32
 
        result = self.b.test('funcnames googletalk')
33
 
        self.assert_(stringinlist("can't find", result))