def test_040_choices_configuration(self):
    'Should accept predefined choices'
    caller = self.get_caller([ConfigurationPlugin])
    self.assertTrue(caller('required-choice', 'yes'))
    with unittest.mock.patch('sys.stderr', new=io.StringIO()):
        with self.assertRaises(SystemExit):
            caller('required-choice', 'unavailable')
Should accept predefined choices
def test_040_choices_configuration(self):
    
    caller = self.get_caller([ConfigurationPlugin])
    self.assertTrue(caller('required-choice', 'yes'))
    with unittest.mock.patch('sys.stderr', new=io.StringIO()):
        with self.assertRaises(SystemExit):
            caller('required-choice', 'unavailable')