def test_transaction_iterate():
    session = get_session()
    session2 = get_session()
    keyid = key('test_transaction_iterate')
    list1 = session.set(keyid, 'abc', List)
    list2 = session2.get(keyid, List)
    for trial in Transaction(session, [keyid]):
        up = list1[0].upper()
        if trial < 3:
            list2.append('x')
        list1[0] = up
    assert list1[:] == list2[:] == list('Abcxxx')
    assert trial == 3
dataset/ETHPy150Open dahlia/sider/sidertests/test_transaction.py/test_transaction_iterate/original