Skip to content

Commit

Permalink
chore(test): cover unescaped dollar sign in env var
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Wobrock committed Sep 5, 2023
1 parent 928a654 commit fe59a81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down
3 changes: 3 additions & 0 deletions tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions tests/test_env.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit fe59a81

Please sign in to comment.