Changeset - d8b0a56fb4c6
[Not reviewed]
0 2 0
Brett Smith - 4 years ago 2020-03-25 18:03:25
brettcsmith@brettcsmith.org
tests: Set a default CONSERVANCY_REPOSITORY for testing.
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
tests/conftest.py
Show inline comments
...
 
@@ -8,3 +8,2 @@ from . import testutil
 
def clean_environment():
 
    os.environ.pop('CONSERVANCY_REPOSITORY', None)
 
    os.environ.pop('RTAUTH', None)
...
 
@@ -13,2 +12,3 @@ def clean_environment():
 
    os.environ.pop('RTUSER', None)
 
    os.environ['CONSERVANCY_REPOSITORY'] = str(testutil.test_path('repository'))
 
    os.environ['HOME'] = str(testutil.test_path('userconfig'))
tests/test_config.py
Show inline comments
...
 
@@ -75,9 +75,9 @@ def update_environ(**kwargs):
 
def test_repository_from_environment():
 
    with update_environ(CONSERVANCY_REPOSITORY='/usr/local'):
 
        config = config_mod.Config()
 
        assert config.repository_path().parts == ('/', 'usr', 'local')
 
    config = config_mod.Config()
 
    assert config.repository_path() == testutil.test_path('repository')
 

	
 
def test_no_repository():
 
    config = config_mod.Config()
 
    assert config.repository_path() is None
 
    with update_environ(CONSERVANCY_REPOSITORY=None):
 
        config = config_mod.Config()
 
        assert config.repository_path() is None
 

	
0 comments (0 inline, 0 general)