Gentoo Archives: gentoo-commits

From: "Petteri Räty" <betelgeuse@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/council-webapp:master commit in: bot/tests/
Date: Thu, 28 Jul 2011 20:02:21
Message-Id: 98c8db34bdd0c7287ba4ffaf3f7d3f720cc01cec.betelgeuse@gentoo
1 commit: 98c8db34bdd0c7287ba4ffaf3f7d3f720cc01cec
2 Author: Joachim Filip Ignacy Bartosik <jbartosik <AT> gmail <DOT> com>
3 AuthorDate: Mon Jul 25 13:20:27 2011 +0000
4 Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 25 13:21:38 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/council-webapp.git;a=commit;h=98c8db34
7
8 Fix failing supybot test
9
10 ---
11 bot/tests/run_test.py | 13 +++++++++----
12 1 files changed, 9 insertions(+), 4 deletions(-)
13
14 diff --git a/bot/tests/run_test.py b/bot/tests/run_test.py
15 index 136e135..3f84ccb 100644
16 --- a/bot/tests/run_test.py
17 +++ b/bot/tests/run_test.py
18 @@ -54,16 +54,21 @@ class MeetBotTest(unittest.TestCase):
19 doesn't have a useful status code, so I need to parse the
20 output.
21 """
22 - os.symlink("../MeetBot", "MeetBot")
23 - os.symlink("../ircmeeting", "ircmeeting")
24 +
25 + links_to_remove = []
26 + for file in ["MeetBot", "ircmeeting"]:
27 + if not os.path.exists(file):
28 + os.symlink("../" + file , file)
29 + links_to_remove.append(file)
30 +
31 sys.path.insert(0, ".")
32 try:
33 output = os.popen("supybot-test ./MeetBot 2>&1").read()
34 assert 'FAILED' not in output, "supybot-based tests failed."
35 assert '\nOK\n' in output, "supybot-based tests failed."
36 finally:
37 - os.unlink("MeetBot")
38 - os.unlink("ircmeeting")
39 + for link in links_to_remove:
40 + os.unlink(link)
41 del sys.path[0]
42
43 trivial_contents = """