def test_wire():

    class Product2(Product):
        x = Bit
        y = Bit
    t0 = Product2(name='t0')
    t1 = Product2(name='t1')
    wire(t0, t1)
    assert t0.wired()
    assert t1.wired()
    assert (t1.value() is t0)
    assert (t0.value() is t1)
    assert (t0.driving() == dict(x=[t1.x], y=[t1.y]))
    b0 = t0.x
    b1 = t1.x
    assert (b0 is b1._wire.driver.bit)
    assert (b1 is b0._wire.driving()[0])
    assert (b1.value() is b0)
def test_wire():

    class Product2(Product):
        x = Bit
        y = Bit
    t0 = Product2(name='t0')
    t1 = Product2(name='t1')
    wire(t0, t1)
    assert t0.wired()
    assert t1.wired()
    assert (t1.value() is t0)
    assert (t0.value() is t1)
    assert (t0.driving() == dict(x=[t1.x], y=[t1.y]))
    b0 = t0.x
    b1 = t1.x
    assert (b0 is b1._wire.driver.bit)
    assert (b1 is b0._wire.driving()[0])
    assert (b1.value() is b0)