From d372a86fe60ef7bcff1f13c0ce10b629a41788bf Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 23 Jun 2022 10:41:04 -0700 Subject: [PATCH] Code formatting. --- borgmatic/config/environment.py | 4 +++- tests/unit/config/test_environment.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/borgmatic/config/environment.py b/borgmatic/config/environment.py index f79dfc9..3a58566 100644 --- a/borgmatic/config/environment.py +++ b/borgmatic/config/environment.py @@ -1,7 +1,9 @@ import os import re -_VARIABLE_PATTERN = re.compile(r'(?P\\)?(?P\$\{(?P[A-Za-z0-9_]+)((:?-)(?P[^}]+))?\})') +_VARIABLE_PATTERN = re.compile( + r'(?P\\)?(?P\$\{(?P[A-Za-z0-9_]+)((:?-)(?P[^}]+))?\})' +) def _resolve_string(matcher): diff --git a/tests/unit/config/test_environment.py b/tests/unit/config/test_environment.py index 6f5d1df..b7b56dd 100644 --- a/tests/unit/config/test_environment.py +++ b/tests/unit/config/test_environment.py @@ -16,6 +16,7 @@ def test_env_braces(monkeypatch): module.resolve_env_variables(config) assert config == {'key': 'Hello foo'} + def test_env_multi(monkeypatch): monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo') monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar') @@ -23,6 +24,7 @@ def test_env_multi(monkeypatch): module.resolve_env_variables(config) assert config == {'key': 'Hello foobar'} + def test_env_escape(monkeypatch): monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo') monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar')