Browse Source

Code formatting.

Dan Helfman 3 years ago
parent
commit
d372a86fe6
2 changed files with 5 additions and 1 deletions
  1. 3 1
      borgmatic/config/environment.py
  2. 2 0
      tests/unit/config/test_environment.py

+ 3 - 1
borgmatic/config/environment.py

@@ -1,7 +1,9 @@
 import os
 import os
 import re
 import re
 
 
-_VARIABLE_PATTERN = re.compile(r'(?P<escape>\\)?(?P<variable>\$\{(?P<name>[A-Za-z0-9_]+)((:?-)(?P<default>[^}]+))?\})')
+_VARIABLE_PATTERN = re.compile(
+    r'(?P<escape>\\)?(?P<variable>\$\{(?P<name>[A-Za-z0-9_]+)((:?-)(?P<default>[^}]+))?\})'
+)
 
 
 
 
 def _resolve_string(matcher):
 def _resolve_string(matcher):

+ 2 - 0
tests/unit/config/test_environment.py

@@ -16,6 +16,7 @@ def test_env_braces(monkeypatch):
     module.resolve_env_variables(config)
     module.resolve_env_variables(config)
     assert config == {'key': 'Hello foo'}
     assert config == {'key': 'Hello foo'}
 
 
+
 def test_env_multi(monkeypatch):
 def test_env_multi(monkeypatch):
     monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo')
     monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo')
     monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar')
     monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar')
@@ -23,6 +24,7 @@ def test_env_multi(monkeypatch):
     module.resolve_env_variables(config)
     module.resolve_env_variables(config)
     assert config == {'key': 'Hello foobar'}
     assert config == {'key': 'Hello foobar'}
 
 
+
 def test_env_escape(monkeypatch):
 def test_env_escape(monkeypatch):
     monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo')
     monkeypatch.setenv('MY_CUSTOM_VALUE', 'foo')
     monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar')
     monkeypatch.setenv('MY_CUSTOM_VALUE2', 'bar')