Ejemplo n.º 1
0
def test_supplier_resets():
    blah_supplier = Supplier("blah")

    with blah_supplier.use("hello"):
        pass
    with pytest.raises(Exception):
        blah_supplier.get()
Ejemplo n.º 2
0
def test_supplier_can_be_used_multiple_times():
    foo_supplier = Supplier("foo")

    with foo_supplier.use("hello"):
        assert foo_supplier.get() == "hello"

    with foo_supplier.use("hi"):
        assert foo_supplier.get() == "hi"
Ejemplo n.º 3
0
def test_supplier_supplies():
    blah_supplier = Supplier("blah")
    with blah_supplier.use("hello"):
        assert blah_supplier.get() == "hello"