blob: af4d9f51b62e8cf0568a4a8a8bb595b3c9549153 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# Richard Darst, 2009
import os
import sys
import unittest
running_tests = True
class MeetBotTest(unittest.TestCase):
def test_replay(self):
"""Replay of a meeting, using __meeting__.
"""
sys.argv[1:] = ["replay", "test-script-1.log.txt"]
sys.path.insert(0, "..")
try:
execfile("../meeting.py", globals())
finally:
del sys.path[0]
def test_supybottests(self):
"""Test by sending input to supybot, check responses.
Uses the external supybot-test command. Unfortunantly, that
doesn't have a useful status code, so I need to parse the
output.
"""
os.symlink("..", "MeetBot")
try:
output = os.popen("supybot-test ./MeetBot 2>&1").read()
print output
assert 'FAILED' not in output, "supybot-based tests failed."
finally:
os.unlink("MeetBot")
if __name__ == '__main__':
os.chdir(os.path.join(os.path.dirname(__file__), '.'))
unittest.main()
|