-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathtest_configuration.py
More file actions
43 lines (38 loc) · 1.08 KB
/
test_configuration.py
File metadata and controls
43 lines (38 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
import os
import pytest
from chaoslib.configuration import load_configuration
def test_should_load_configuration():
os.environ["KUBE_TOKEN"] = "value2"
config = load_configuration({
"token1": "value1",
"token2": {
"type": "env",
"key": "KUBE_TOKEN"
},
"token3": {
"type": "probe",
"name": "Get some value from a process",
"provider": {
"type": "process",
"path": "echo",
"arguments": ["-n", "value3"]
}
},
"token4": {
"type": "probe",
"name": "Get some value from Python",
"provider": {
"type": "python",
"module": "string",
"func": "capwords",
"arguments": {
"s": "value4"
}
}
}
})
assert config["token1"] == "value1"
assert config["token2"] == "value2"
assert config["token3"] == "value3"
assert config["token4"] == "Value4"