changeset 885:627b709d6907

Use custom config file prefix and cleanup after test.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 09 Aug 2008 14:57:07 +0200
parents 74860b8b1b98
children 1354833d6d7d
files viff/test/test_apps.py
diffstat 1 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/viff/test/test_apps.py	Sat Aug 09 14:46:01 2008 +0200
+++ b/viff/test/test_apps.py	Sat Aug 09 14:57:07 2008 +0200
@@ -51,11 +51,15 @@
         os.chdir(path.join(root_dir, "apps"))
 
         p = execute("generate-config-files.py", "-n", "3", "-t", "1",
+                    "-p", "trial",
                     "localhost:10000", "localhost:20000", "localhost:30000")
         return p
 
     def tearDown(self):
         """Switch back to the old working directory."""
+        os.unlink("trial-1.ini")
+        os.unlink("trial-2.ini")
+        os.unlink("trial-3.ini")
         os.chdir(self.oldcwd)
 
     def test_millionaires(self):
@@ -79,9 +83,9 @@
                 subtext = "\n".join(lines)
                 self.assertIn(subtext, o)
 
-        m1 = execute("millionaires.py", "player-1.ini")
-        m2 = execute("millionaires.py", "player-2.ini")
-        m3 = execute("millionaires.py", "player-3.ini")
+        m1 = execute("millionaires.py", "trial-1.ini")
+        m2 = execute("millionaires.py", "trial-2.ini")
+        m3 = execute("millionaires.py", "trial-3.ini")
         
         result = gatherResults([m1, m2, m3])
         result.addCallback(check_outputs)
@@ -96,9 +100,9 @@
                 self.assertIn("opened b: %s" % GF256(40), o)
                 self.assertIn("opened c: %s" % GF256(235), o)
 
-        p1 = execute("share-open.py", "player-1.ini", "17")
-        p2 = execute("share-open.py", "player-2.ini", "40")
-        p3 = execute("share-open.py", "player-3.ini", "235")
+        p1 = execute("share-open.py", "trial-1.ini", "17")
+        p2 = execute("share-open.py", "trial-2.ini", "40")
+        p3 = execute("share-open.py", "trial-3.ini", "235")
         
         result = gatherResults([p1, p2, p3])
         result.addCallback(check_outputs)
@@ -118,9 +122,9 @@
             self.assertEqual(lines[0], lines[1])
             self.assertEqual(lines[1], lines[2])
 
-        p1 = execute("prss-and-open.py", "player-1.ini")
-        p2 = execute("prss-and-open.py", "player-2.ini")
-        p3 = execute("prss-and-open.py", "player-3.ini")
+        p1 = execute("prss-and-open.py", "trial-1.ini")
+        p2 = execute("prss-and-open.py", "trial-2.ini")
+        p3 = execute("prss-and-open.py", "trial-3.ini")
         
         result = gatherResults([p1, p2, p3])
         result.addCallback(check_outputs)