mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Added test case for invalid config file exception handling
This commit is contained in:
parent
2b97a93667
commit
f8c1d52643
@ -229,6 +229,13 @@ def test_file_config():
|
|||||||
assert config == {}
|
assert config == {}
|
||||||
|
|
||||||
|
|
||||||
|
def test_invalid_file_config():
|
||||||
|
from bigchaindb.config_utils import file_config, CONFIG_DEFAULT_PATH
|
||||||
|
with patch('builtins.open', mock_open(read_data='{_INVALID_JSON_}')) as m:
|
||||||
|
with pytest.raises(exceptions.ConfigurationError):
|
||||||
|
file_config()
|
||||||
|
|
||||||
|
|
||||||
def test_write_config():
|
def test_write_config():
|
||||||
from bigchaindb.config_utils import write_config, CONFIG_DEFAULT_PATH
|
from bigchaindb.config_utils import write_config, CONFIG_DEFAULT_PATH
|
||||||
m = mock_open()
|
m = mock_open()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user