Ejemplo n.º 1
0
def test_write():
    clear()

    assert not os.path.isfile(settings.DB)

    utils.write(fake_useragent_dict)

    assert os.path.isfile(settings.DB)
Ejemplo n.º 2
0
def test_write():
    clear()

    assert not os.path.isfile(settings.DB)

    utils.write(fake_useragent_dict)

    assert os.path.isfile(settings.DB)
Ejemplo n.º 3
0
def test_utils_write(path):
    data = {'foo': 'bar'}

    utils.write(path, data)

    with io.open(path, mode='rt', encoding='utf-8') as fp:
        expected = json.loads(fp.read())

    assert expected == data
Ejemplo n.º 4
0
def test_utils_write(path):
    data = {'foo': 'bar'}

    utils.write(path, data)

    with io.open(path, mode='rt', encoding='utf-8') as fp:
        expected = json.loads(fp.read())

    assert expected == data