def test_invalid_config_file():
"""Test that an invalid `two1.json` file cannot be imported."""
mock_config = mock.mock_open(mock=mock.Mock(side_effect=ValueError))
with mock.patch('two1.commands.util.config.open', mock_config, create=True), pytest.raises(exceptions.FileDecodeError): # nopep8
config.Config('config_file')
mock_config.assert_called_with('config_file', mode='r')
评论列表
文章目录