diff options
author | kali <kali@leap.se> | 2012-08-30 00:36:50 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-30 00:42:29 +0900 |
commit | 1263cd7a3cfca81ae3e6976a489e2d3d4013d64b (patch) | |
tree | 95e6897a949d8772248a52ee714eec19bd2c6e72 /src/leap/eip/tests/data.py | |
parent | ed4ad3a392caf0211e51a48d2d7b6c5a2f7bb17a (diff) |
add lazy evaluation to config specs
now callables are allowed in specs *only at one level depth*
to allow for last-minute evaluation on context-sensitive data,
like paths affected by os.environ
also some minor modifications to make check tests pass after
putting the new jsonconfig-based eipconfig in place.
aaaaaall green again :)
Diffstat (limited to 'src/leap/eip/tests/data.py')
-rw-r--r-- | src/leap/eip/tests/data.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/leap/eip/tests/data.py b/src/leap/eip/tests/data.py new file mode 100644 index 00000000..9067c270 --- /dev/null +++ b/src/leap/eip/tests/data.py @@ -0,0 +1,50 @@ +from __future__ import unicode_literals +import os + +# sample data used in tests + +EIP_SAMPLE_JSON = { + "provider": "testprovider.example.org", + "transport": "openvpn", + "openvpn_protocol": "tcp", + "openvpn_port": 80, + "openvpn_ca_certificate": os.path.expanduser( + "~/.config/leap/providers/" + "testprovider.example.org/" + "keys/ca/testprovider-ca-cert.pem"), + "openvpn_client_certificate": os.path.expanduser( + "~/.config/leap/providers/" + "testprovider.example.org/" + "keys/client/openvpn.pem"), + "connect_on_login": True, + "block_cleartext_traffic": True, + "primary_gateway": "usa_west", + "secondary_gateway": "france", + #"management_password": "oph7Que1othahwiech6J" +} + +EIP_SAMPLE_SERVICE = { + "serial": 1, + "version": "0.1.0", + "capabilities": { + "transport": ["openvpn"], + "ports": ["80", "53"], + "protocols": ["udp", "tcp"], + "static_ips": True, + "adblock": True + }, + "gateways": [ + {"country_code": "us", + "label": {"en":"west"}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]}, + {"country_code": "us", + "label": {"en":"east"}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]}, + {"country_code": "fr", + "label": {}, + "capabilities": {}, + "hosts": ["1.2.3.4", "1.2.3.5"]} + ] +} |