Exemple #1
0
class TestManager(Manager):
    config = Config(stages={'sum': {'a': 1, 'b': 2, 'c': 3}})

    def setup_pipeline(self):
        self.register_stage('sum', SumStage(self.factory))
        self.register_stage('string', StringStage(self.factory))
        self.register_stage('globalvars', GlobalStage(self.factory))

    def setup_products(self, name, d):
        i = DummyInstrument()
        p = Product(manager=self, instrument=i)
        self.add_product(name, p)
        p.add_target('globalvars')
        self.set_value(p, 'd', d)
Exemple #2
0
def test_config_item_del_freezing():
    with pytest.raises(FrozenError):
        c = Config()
        c['test'] = 1
        c.freeze()
        del c['test']
Exemple #3
0
def test_config_attr_del_freezing():
    with pytest.raises(FrozenError):
        c = Config()
        c.test = 1
        c.freeze()
        del c.test
Exemple #4
0
def test_config_item_freezing():
    with pytest.raises(FrozenError):
        c = Config()
        c.freeze()
        c['testing_value'] = 1