Exemplo n.º 1
0
def test_option_context():
    from lttngcluster.api import TraceExperimentOptions

    opts = TraceExperimentOptions()
    opts['parameters'] = {
        'delay': [1, 2, 3]
    }

    exp = [ { 'delay': 1 }, { 'delay': 2 }, { 'delay': 3 } ]
    act = []
    for ctx in opts.context_generator():
        assert ctx == opts.get_context()
        assert ctx == opts.get_context()
        act.append(ctx)
    assert exp == act