Total Complexity | 14 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | class TestBase(): |
||
2 | conf = 'tests/test_pybotrc' |
||
3 | def testConfExistence(self): |
||
4 | f = open (TestBase.conf) |
||
5 | assert f is not None |
||
6 | |||
7 | def testConfman(self): |
||
8 | import confman |
||
9 | cm = confman.ConfManager(TestBase.conf) |
||
10 | |||
11 | def testBase(self): |
||
12 | import bot |
||
13 | import confman |
||
14 | assert bot.Bot(confman.ConfManager(TestBase.conf), "zero9f9.com") is not None, "bot is None!" |
||
15 | |||
16 | # this one you might want to remove, since it connects to a hardcoded ircd |
||
17 | def testBotSocket(self): |
||
18 | import bot |
||
19 | import confman |
||
20 | b = bot.Bot(confman.ConfManager(TestBase.conf), "zero9f9.com", True) |
||
21 | b.worker(mock=True) |
||
22 | assert b.s is not None |
||
23 | |||
24 | # if this fails someone screwed something up |
||
25 | def testEventMatches(self): |
||
26 | import event |
||
27 | e = event.Event('__.test__') |
||
28 | assert e is not None |
||
29 | assert e._type is not None and e._type == "__.test__" |
||
30 | e.define(msg_definition="^test") |
||
31 | assert e.msg_definition == "^test" |
||
32 | assert e.matches(":[email protected] PRIVMSG #bots :test") == True |
||
33 | |||
34 | def testLoad(self): |
||
35 | import bot |
||
36 | import confman |
||
37 | b = bot.Bot(confman.ConfManager(TestBase.conf), "zero9f9.com", True) |
||
38 | b.load_modules() |
||
39 | assert len(b.loaded_modules) > 0 |
||
40 |