Ejemplo n.º 1
0
def mock_application():
    tf = mock.Mock()
    df = mock.Mock()

    a = Controller(timefcn=tf, delayfcn=df)

    s = mock_source('Source 1')
    a.add_source(s)

    for count in range(2):
        t = mock_target('Target {}'.format(count + 1))
        a.add_target(t)

    a._read_sources = mock.Mock(wraps=a._read_sources)
    a._update_targets = mock.Mock(wraps=a._update_targets)

    return a