~pete-woods/+junk/Spiegel-Scope

« back to all changes in this revision

Viewing changes to tests/unit/scope/test-scope.py

  • Committer: Pete Woods
  • Date: 2015-04-24 11:48:56 UTC
  • Revision ID: pete.woods@canonical.com-20150424114856-6vizef6dzs10hrmw
Start python fake server

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
from scope_harness import *
4
4
from scope_harness.testing import *
5
 
import unittest, sys
 
5
import unittest, sys, os
 
6
from subprocess import Popen, PIPE
6
7
 
7
8
class AppsTest (ScopeHarnessTestCase):
8
9
    @classmethod
9
10
    def setUpClass(cls):
 
11
        cls.process = Popen(["/usr/bin/python3", FAKE_SERVER], stdout=PIPE)
 
12
        port = cls.process.stdout.readline().decode("utf-8").rstrip('\n')
 
13
        os.environ["NETWORK_SCOPE_APIROOT"] = "http://127.0.0.1:" + port
 
14
 
10
15
        cls.harness = ScopeHarness.new_from_scope_list(Parameters([
11
16
            SCOPE_INI
12
17
            ]))
71
76
if __name__ == '__main__':
72
77
    SCOPE_NAME = sys.argv[1]
73
78
    SCOPE_INI = sys.argv[2]
 
79
    FAKE_SERVER = sys.argv[3]
74
80
 
75
81
    unittest.main(argv = sys.argv[:1])