from magma.common import prologue, epilogue


def test_prologue():

    def prologue_fn(lst):
        lst[0] = True

    @prologue(prologue_fn)
    def fn(lst):
        assert lst[0] is True
        lst[1] = True

    fn([False for _ in range(10)])


def test_epilogue():

    def epilogue_fn(lst):
        lst[0] = True

    @epilogue(epilogue_fn)
    def fn(lst):
        assert lst[0] is False
        lst[1] = True

    my_lst = [False for _ in range(10)]
    fn(my_lst)
    assert my_lst[0] is True

ecb81b70706f30693659d1bc65341c4ad839ede7
<mask token>

<mask token>


def test_prologue():

    def prologue_fn(lst):
        lst[0] = True

    @prologue(prologue_fn)
    def fn(lst):
        assert lst[0] is True
        lst[1] = True
    fn([(False) for _ in range(10)])


<mask token>

<mask token>


def test_prologue():

    def prologue_fn(lst):
        lst[0] = True

    @prologue(prologue_fn)
    def fn(lst):
        assert lst[0] is True
        lst[1] = True
    fn([(False) for _ in range(10)])


def test_epilogue():

    def epilogue_fn(lst):
        lst[0] = True

    @epilogue(epilogue_fn)
    def fn(lst):
        assert lst[0] is False
        lst[1] = True
    my_lst = [(False) for _ in range(10)]
    fn(my_lst)
    assert my_lst[0] is True

from magma.common import prologue, epilogue


def test_prologue():

    def prologue_fn(lst):
        lst[0] = True

    @prologue(prologue_fn)
    def fn(lst):
        assert lst[0] is True
        lst[1] = True
    fn([(False) for _ in range(10)])


def test_epilogue():

    def epilogue_fn(lst):
        lst[0] = True

    @epilogue(epilogue_fn)
    def fn(lst):
        assert lst[0] is False
        lst[1] = True
    my_lst = [(False) for _ in range(10)]
    fn(my_lst)
    assert my_lst[0] is True

from magma.common import prologue, epilogue


def test_prologue():

    def prologue_fn(lst):
        lst[0] = True

    @prologue(prologue_fn)
    def fn(lst):
        assert lst[0] is True
        lst[1] = True

    fn([False for _ in range(10)])


def test_epilogue():

    def epilogue_fn(lst):
        lst[0] = True

    @epilogue(epilogue_fn)
    def fn(lst):
        assert lst[0] is False
        lst[1] = True

    my_lst = [False for _ in range(10)]
    fn(my_lst)
    assert my_lst[0] is True
