def test_key_value_strings_callback():
ctx = None
param = None
# Check empty result
assert key_value_strings_callback(ctx, param, None) == {}
# Check result for a list of values
values = ['foo=bar', 'hello=world', 'wacky=value=go']
assert key_value_strings_callback(ctx, param, values) == {
'foo': 'bar',
'hello': 'world',
'wacky': 'value=go',
}
# Check invalid parameter format error
with pytest.raises(click.BadParameter):
key_value_strings_callback(ctx, param, ['boom'])
评论列表
文章目录