Skip to content

Commit 8153122

Browse files
committed
Added unit test
1 parent 4a11094 commit 8153122

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_autoconfig.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,13 @@ def test_autoconfig_env_default_encoding():
9797
assert config.encoding == DEFAULT_ENCODING
9898
assert 'ENV' == config('KEY', default='ENV')
9999
mopen.assert_called_once_with(filename, encoding=DEFAULT_ENCODING)
100+
101+
102+
def test_autoconfig_no_repository():
103+
path = os.path.join(os.path.dirname(__file__), 'autoconfig', 'ini', 'no_repository')
104+
config = AutoConfig(path)
105+
106+
with pytest.raises(UndefinedValueError):
107+
config('KeyNotInEnvAndNotInRepository')
108+
109+
assert isinstance(config.config.repository, RepositoryEmpty)

0 commit comments

Comments
 (0)