def test_randomizer_basic(self):
    '\n        Test functionality of basic randomizer.\n        '
    randomizer = EnvParameterRandomizer(DummyEnvParameter())
    assert (len(randomizer.get_parameters()) == 3)
    with self.assertRaises(AssertionError):
        randomizer.register_parameter(DummyRandomizerParameter('a', 1))
    randomizer.register_parameter(DummyRandomizerParameter('d', 1))
    assert (len(randomizer.get_parameters()) == 4)
    randomizer.get_parameter('a').set_value(1)
    randomizer.get_parameter('b').set_value(0.5)
    randomizer.get_parameter('c').set_value(2)
    parameters = randomizer.randomize(DummyEnvParameter(), self.random_state)
    assert (parameters.a == 1)
    assert (parameters.b == 0.5)
    assert (parameters.nested.c == 2)
    randomizer.disable()
    parameters = randomizer.randomize(DummyEnvParameter(), self.random_state)
    randomizer.get_parameter('a').set_value(1)
    assert (parameters.a == 0)
Test functionality of basic randomizer.
def test_randomizer_basic(self):
    '\n        \n        '
    randomizer = EnvParameterRandomizer(DummyEnvParameter())
    assert (len(randomizer.get_parameters()) == 3)
    with self.assertRaises(AssertionError):
        randomizer.register_parameter(DummyRandomizerParameter('a', 1))
    randomizer.register_parameter(DummyRandomizerParameter('d', 1))
    assert (len(randomizer.get_parameters()) == 4)
    randomizer.get_parameter('a').set_value(1)
    randomizer.get_parameter('b').set_value(0.5)
    randomizer.get_parameter('c').set_value(2)
    parameters = randomizer.randomize(DummyEnvParameter(), self.random_state)
    assert (parameters.a == 1)
    assert (parameters.b == 0.5)
    assert (parameters.nested.c == 2)
    randomizer.disable()
    parameters = randomizer.randomize(DummyEnvParameter(), self.random_state)
    randomizer.get_parameter('a').set_value(1)
    assert (parameters.a == 0)