viff

changeset 845:8bf14cf5dd0a

Test case for apps/prss-and-open.py.
author Martin Geisler <mg@daimi.au.dk>
date Tue, 22 Jul 2008 00:00:54 +0200
parents 4e84893a1725
children 92c63c37937b
files viff/test/test_apps.py
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/viff/test/test_apps.py	Mon Jul 21 23:46:32 2008 +0200
     1.2 +++ b/viff/test/test_apps.py	Tue Jul 22 00:00:54 2008 +0200
     1.3 @@ -99,3 +99,25 @@
     1.4          result = gatherResults([p1, p2, p3])
     1.5          result.addCallback(check_outputs)
     1.6          return result
     1.7 +
     1.8 +    def test_prss_and_open(self):
     1.9 +        """Test apps/prss-and-open.py."""
    1.10 +        
    1.11 +        def check_outputs(outputs):
    1.12 +            lines = []
    1.13 +            for o in outputs:
    1.14 +                for line in o.splitlines():
    1.15 +                    if line.startswith("bits:"):
    1.16 +                        lines.append(line)
    1.17 +                        break
    1.18 +            self.assertEqual(len(lines), 3)
    1.19 +            self.assertEqual(lines[0], lines[1])
    1.20 +            self.assertEqual(lines[1], lines[2])
    1.21 +
    1.22 +        p1 = execute('prss-and-open.py', 'player-1.ini')
    1.23 +        p2 = execute('prss-and-open.py', 'player-2.ini')
    1.24 +        p3 = execute('prss-and-open.py', 'player-3.ini')
    1.25 +        
    1.26 +        result = gatherResults([p1, p2, p3])
    1.27 +        result.addCallback(check_outputs)
    1.28 +        return result