def test_string_with_choices_type(self):
class Option(StringOption):
metadata = 'name'
choices = ['one', 'two', 'three']
cli = ['--name']
click_option = ClickObjectOption(Option)
self.assertIsInstance(click_option.type, click.Choice)
self.assertEqual(click_option.type.choices, ['one', 'two', 'three'])
评论列表
文章目录