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

    with blah_supplier.use("hello"):
        pass
    with pytest.raises(Exception):
        blah_supplier.get()
Esempio 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"
Esempio n. 3
0
def test_supplier_supplies():
    blah_supplier = Supplier("blah")
    with blah_supplier.use("hello"):
        assert blah_supplier.get() == "hello"