From fe59a8175b58390110f2057231c49529b33845a6 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Tue, 5 Sep 2023 09:25:14 +0200 Subject: [PATCH] chore(test): cover unescaped dollar sign in env var --- tests/fixtures.py | 1 + tests/test_env.py | 3 +++ tests/test_env.txt | 1 + 3 files changed, 5 insertions(+) diff --git a/tests/fixtures.py b/tests/fixtures.py index 69e5e90f..32997287 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -65,6 +65,7 @@ def generate_data(cls): BOOL_FALSE_STRING_LIKE_BOOL='False', BOOL_FALSE_BOOL=False, PROXIED_VAR='$STR_VAR', + DOLLAR_VAR='SOME_VALUE$S3CR3TK3Y@HELLO', ESCAPED_VAR=r'\$baz', INT_LIST='42,33', INT_TUPLE='(42,33)', diff --git a/tests/test_env.py b/tests/test_env.py index 0b105f55..daecb8f5 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -134,6 +134,9 @@ def test_bool_true(self, value, variable): def test_proxied_value(self): assert self.env('PROXIED_VAR') == 'bar' + def test_dollar_sign(self): + assert self.env('DOLLAR_VAR') == 'SOME_VALUE$S3CR3TK3Y@HELLO' + def test_escaped_dollar_sign(self): self.env.escape_proxy = True assert self.env('ESCAPED_VAR') == '$baz' diff --git a/tests/test_env.txt b/tests/test_env.txt index d5480bf6..eea7cf2c 100644 --- a/tests/test_env.txt +++ b/tests/test_env.txt @@ -40,6 +40,7 @@ FLOAT_STRANGE_VAR1=123,420,333.3 FLOAT_STRANGE_VAR2=123.420.333,3 FLOAT_NEGATIVE_VAR=-1.0 PROXIED_VAR=$STR_VAR +DOLLAR_VAR=SOME_VALUE$S3CR3TK3Y@HELLO ESCAPED_VAR=\$baz EMPTY_LIST= EMPTY_INT_VAR=