From 98c8db34bdd0c7287ba4ffaf3f7d3f720cc01cec Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Mon, 25 Jul 2011 15:20:27 +0200 Subject: Fix failing supybot test --- bot/tests/run_test.py | 13 +++++++++---- 1 file 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 = """ -- cgit v1.2.3-65-gdbad