aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bot/tests/run_test.py')
-rw-r--r--bot/tests/run_test.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/bot/tests/run_test.py b/bot/tests/run_test.py
index 136e135..3f84ccb 100644
--- a/bot/tests/run_test.py
+++ b/bot/tests/run_test.py
@@ -54,16 +54,21 @@ class MeetBotTest(unittest.TestCase):
doesn't have a useful status code, so I need to parse the
output.
"""
- os.symlink("../MeetBot", "MeetBot")
- os.symlink("../ircmeeting", "ircmeeting")
+
+ links_to_remove = []
+ for file in ["MeetBot", "ircmeeting"]:
+ if not os.path.exists(file):
+ os.symlink("../" + file , file)
+ links_to_remove.append(file)
+
sys.path.insert(0, ".")
try:
output = os.popen("supybot-test ./MeetBot 2>&1").read()
assert 'FAILED' not in output, "supybot-based tests failed."
assert '\nOK\n' in output, "supybot-based tests failed."
finally:
- os.unlink("MeetBot")
- os.unlink("ircmeeting")
+ for link in links_to_remove:
+ os.unlink(link)
del sys.path[0]
trivial_contents = """