def test_invalid_file_config(): from bigchaindb.config_utils import file_config from bigchaindb.common import exceptions with patch('builtins.open', mock_open(read_data='{_INVALID_JSON_}')): with pytest.raises(exceptions.ConfigurationError): file_config()
def test_invalid_file_config(): from bigchaindb.config_utils import file_config from bigchaindb.common import exceptions with patch('builtins.open', mock_open(read_data='{_INVALID_JSON_}')): with pytest.raises(exceptions.ConfigurationError): file_config()
def test_file_config(): from bigchaindb.config_utils import file_config, CONFIG_DEFAULT_PATH with patch('builtins.open', mock_open(read_data='{}')) as m: config = file_config() m.assert_called_once_with(CONFIG_DEFAULT_PATH) assert config == {}
def test_file_config(): from bigchaindb.config_utils import file_config, CONFIG_DEFAULT_PATH with patch('builtins.open', mock_open(read_data='{}')) as m: config = file_config() m.assert_called_once_with(CONFIG_DEFAULT_PATH) assert config == {}