def test_list_remove_clear_params(self):
        self.top.add('comp', SphereFunction())
        self.top.driver.workflow.add('comp')
        self.top.driver.add_parameter('comp.x')
        self.top.driver.add_parameter('comp.y')

        params = self.top.driver.list_param_targets()
        self.assertEqual(set(params), set(['comp.x', 'comp.y']))
        self.assertEqual(len(params), 2)

        self.top.driver.remove_parameter('comp.x')
        params = self.top.driver.list_param_targets()
        self.assertEqual(params, ['comp.y'])

        try:
            self.top.driver.remove_parameter('xyz')
        except __HOLE__ as err:
            self.assertEqual(str(err),
                             "driver: Trying to remove parameter 'xyz' that is "
                             "not in this driver.")
        else:
            self.fail('RuntimeError Expected')

        self.top.driver.add_parameter('comp.x')
        self.top.driver.clear_parameters()
        params = self.top.driver.list_param_targets()
        self.assertEqual(params, [])

        self.top.driver.add_parameter('comp.y')
        try:
            self.top.driver.add_parameter('comp.y')
        except ValueError as err:
            self.assertEqual(str(err),
                             "driver: ['comp.y'] are already Parameter targets")
        else:
            self.fail('RuntimeError expected')
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/drivers/test/test_opt_genetic.py/TestCase.test_list_remove_clear_params