Ejemplo n.º 1
0
def test_no_dublicated_mapping():
    clear()

    m = Model.add_host('alice')
    n = Laboratory.add_device('node1')
    bind(m, n)
    bind(m, n)
    bind(n, m)
    assert len(get_mapping().bindings()) == 1
Ejemplo n.º 2
0
def test_binding():
    clear()

    m = Model.add_host('alice')
    n = Laboratory.add_device('node1')
    bind(m, n)

    assert(m.bound() == n)
    assert(n.bound() == m)
    assert len(get_mapping().bindings()) == 1