Beispiel #1
0
def test_atomic_write(path, exist):
    if exist:
        path.write('')

    with atomic_write(str(path)) as (r,w):
        w.write('haha')

    assert path.read() == 'haha'
Beispiel #2
0
def test_atomic_write(path, exist):
    if exist:
        path.write('')

    with atomic_write(str(path)) as (r, w):
        w.write('haha')

    assert path.read() == 'haha'
Beispiel #3
0
def test_atomic_write_with_reading(existent_path):
    with atomic_write(str(existent_path)) as (r,w):
        for item in r:
            w.write(item)
            w.write(item)
    assert existent_path.read() == 'haha'
Beispiel #4
0
def test_atomic_write_with_reading(existent_path):
    with atomic_write(str(existent_path)) as (r, w):
        for item in r:
            w.write(item)
            w.write(item)
    assert existent_path.read() == 'haha'