def test_invalid_form(self):
        model = Assembly()

        model.add('driver', DistributionCaseDriver())
        model.add('driven', SimpleComponent())
        model.driver.workflow.add('driven')
        model.driver.distribution_generator = FiniteDifferenceGenerator(model.driver)
        model.driver.add_response('driven.y')
        model.driver.add_parameter("driven.x", low=-10., high=10., fd_step=0.1)

        try:
            model.driver.distribution_generator.form = "INVALID_FORM"
        except __HOLE__, err:
            msg = ": Variable 'form' must be in ['CENTRAL', 'FORWARD', 'BACKWARD'], " \
                  "but a value of INVALID_FORM <type 'str'> was specified."
            self.assertEqual(str(err), msg)
        else:
            self.fail('ValueError expected')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/drivers/test/test_distributioncasedriver.py/TestCase.test_invalid_form