Example #1
0
def test_requirements(start, b, c, end):
    start.connect(None, [b, c])
    b.connect([start], [c])
    c.connect([start, b], [end])
    end.connect([c], None)

    assert equals(start.get_requirements(), {'a': ['1'], 'b': ['2']})
    assert equals(b.get_requirements(), {'a': ['2']})
    assert equals(c.get_requirements(), {'a': ['1', '2'], 'b': ['2']})
    assert equals(end.get_requirements(), {})
Example #2
0
def test_requirements(start, b, c, d, end):
    start.connect(None, [b, c])
    b.connect([start], [d])
    c.connect([start], [d])
    d.connect([b, c], [end])
    end.connect([d], None)

    assert equals(start.get_requirements(), {'a': ['1'], 'b': ['1', '2']})
    assert equals(b.get_requirements(), {'a': ['1'], 'b': ['1'], 'e': ['1']})
    assert equals(c.get_requirements(), {'a': ['1', '2'], 'c': ['1', '2']})
    assert equals(d.get_requirements(), {'a': ['1', '2'], 'b': ['1', '2'], 'c': ['1'],
                                     'e': ['1', '2'], 'f': ['1', '2']})
Example #3
0
def test_requirements(start, post_process, handler_process, inputs_process,
                      config_paths):
    start.connect(None, [post_process, handler_process])
    post_process.connect([start], [handler_process])
    handler_process.connect([start, post_process], [inputs_process])
    inputs_process.connect([handler_process], [config_paths])
    config_paths.connect([inputs_process], None)

    assert equals(start.get_requirements(), {
        'volume_counts': ['car'],
        'vkt': ['bus']
    })
    assert equals(post_process.get_requirements(), {'volume_counts': ['bus']})
    assert equals(handler_process.get_requirements(), {
        'events': None,
        'network': None
    })
    assert equals(inputs_process.get_requirements(), {
        'events_path': None,
        'network_path': None
    })
    assert equals(config_paths.get_requirements(), {})
Example #4
0
def test_combine_req(reqs, req):
    assert equals(combine_reqs(reqs), req)
Example #5
0
def test_tool_requirements():
    tool = Tool1(option='1')
    assert equals(tool.get_requirements(), {'a': ['1'], 'b': ['1'], 'e': ['1']})