Browse Source

add test to ensure integers are converted to string
before setting them up to be environment variable values

Signed-off-by: Soumik Dutta <shalearkane@gmail.com>

Soumik Dutta 2 years ago
parent
commit
fb9677230b
2 changed files with 6 additions and 1 deletions
  1. 1 1
      borgmatic/config/schema.yaml
  2. 5 0
      tests/unit/borg/test_environment.py

+ 1 - 1
borgmatic/config/schema.yaml

@@ -318,7 +318,7 @@ properties:
             borg_files_cache_ttl:
                 type: integer
                 description: |
-                    Maximum time to live (ttl) for entries in the borg files
+                    Maximum time to live (ttl) for entries in the Borg files
                     cache.
                 example: 20
             borg_security_directory:

+ 5 - 0
tests/unit/borg/test_environment.py

@@ -32,3 +32,8 @@ def test_make_environment_with_relocated_repo_access_should_override_default():
     environment = module.make_environment({'relocated_repo_access_is_ok': True})
 
     assert environment.get('BORG_RELOCATED_REPO_ACCESS_IS_OK') == 'yes'
+
+
+def test_make_environment_with_integer_variable_value():
+    environment = module.make_environment({'borg_files_cache_ttl': 40})
+    assert environment.get('BORG_FILES_CACHE_TTL') == '40'