viff

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 diff
     1.1 --- a/viff/test/test_apps.py	Sat Aug 09 14:46:01 2008 +0200
     1.2 +++ b/viff/test/test_apps.py	Sat Aug 09 14:57:07 2008 +0200
     1.3 @@ -51,11 +51,15 @@
     1.4          os.chdir(path.join(root_dir, "apps"))
     1.5  
     1.6          p = execute("generate-config-files.py", "-n", "3", "-t", "1",
     1.7 +                    "-p", "trial",
     1.8                      "localhost:10000", "localhost:20000", "localhost:30000")
     1.9          return p
    1.10  
    1.11      def tearDown(self):
    1.12          """Switch back to the old working directory."""
    1.13 +        os.unlink("trial-1.ini")
    1.14 +        os.unlink("trial-2.ini")
    1.15 +        os.unlink("trial-3.ini")
    1.16          os.chdir(self.oldcwd)
    1.17  
    1.18      def test_millionaires(self):
    1.19 @@ -79,9 +83,9 @@
    1.20                  subtext = "\n".join(lines)
    1.21                  self.assertIn(subtext, o)
    1.22  
    1.23 -        m1 = execute("millionaires.py", "player-1.ini")
    1.24 -        m2 = execute("millionaires.py", "player-2.ini")
    1.25 -        m3 = execute("millionaires.py", "player-3.ini")
    1.26 +        m1 = execute("millionaires.py", "trial-1.ini")
    1.27 +        m2 = execute("millionaires.py", "trial-2.ini")
    1.28 +        m3 = execute("millionaires.py", "trial-3.ini")
    1.29          
    1.30          result = gatherResults([m1, m2, m3])
    1.31          result.addCallback(check_outputs)
    1.32 @@ -96,9 +100,9 @@
    1.33                  self.assertIn("opened b: %s" % GF256(40), o)
    1.34                  self.assertIn("opened c: %s" % GF256(235), o)
    1.35  
    1.36 -        p1 = execute("share-open.py", "player-1.ini", "17")
    1.37 -        p2 = execute("share-open.py", "player-2.ini", "40")
    1.38 -        p3 = execute("share-open.py", "player-3.ini", "235")
    1.39 +        p1 = execute("share-open.py", "trial-1.ini", "17")
    1.40 +        p2 = execute("share-open.py", "trial-2.ini", "40")
    1.41 +        p3 = execute("share-open.py", "trial-3.ini", "235")
    1.42          
    1.43          result = gatherResults([p1, p2, p3])
    1.44          result.addCallback(check_outputs)
    1.45 @@ -118,9 +122,9 @@
    1.46              self.assertEqual(lines[0], lines[1])
    1.47              self.assertEqual(lines[1], lines[2])
    1.48  
    1.49 -        p1 = execute("prss-and-open.py", "player-1.ini")
    1.50 -        p2 = execute("prss-and-open.py", "player-2.ini")
    1.51 -        p3 = execute("prss-and-open.py", "player-3.ini")
    1.52 +        p1 = execute("prss-and-open.py", "trial-1.ini")
    1.53 +        p2 = execute("prss-and-open.py", "trial-2.ini")
    1.54 +        p3 = execute("prss-and-open.py", "trial-3.ini")
    1.55          
    1.56          result = gatherResults([p1, p2, p3])
    1.57          result.addCallback(check_outputs)