aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2018-08-26 11:04:55 +0200
committerromangraef <romangraef@loves.dicksinhisan.us>2018-08-26 11:04:55 +0200
commit7bb806a96d4f0ad4dd37a6db8adcf118bd523540 (patch)
tree7f76d668ab10306a05a9b366b42d263ab3d0138c /tests
parent3bd927619d24134b4711f37ae471b7a52c084f3a (diff)
downloadconfiglib-7bb806a96d4f0ad4dd37a6db8adcf118bd523540.tar.gz
configlib-7bb806a96d4f0ad4dd37a6db8adcf118bd523540.tar.bz2
configlib-7bb806a96d4f0ad4dd37a6db8adcf118bd523540.zip
added $ escapes\n\nfor now only `$env:envname` is supported
Diffstat (limited to 'tests')
-rw-r--r--tests/test_something.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_something.py b/tests/test_something.py
index 8091f46..7bb979a 100644
--- a/tests/test_something.py
+++ b/tests/test_something.py
@@ -1,4 +1,5 @@
import json
+import os
from unittest import TestCase
from configlib.model_impl import BaseConfig
@@ -19,6 +20,12 @@ test_dict = {
'a': 1
}
}
+env_dict = {
+ 'something': '$env:ENVVAR',
+ 'ye': {
+ 'a': 1
+ }
+}
def verify_test_dict(conf):
@@ -37,3 +44,8 @@ class TestSomething(TestCase):
def test_text(self):
conf: SomeConfig = SomeConfig.loads(json.dumps(test_dict))
verify_test_dict(conf)
+
+ def test_environ(self):
+ os.environ['ENVVAR'] = 'hmm'
+ conf: SomeConfig = SomeConfig.parse_dict(env_dict)
+ verify_test_dict(conf)