def test_utils_read(path):
    data = {'foo': 'bar'}

    with io.open(path, mode='wt', encoding='utf-8') as fp:
        dumped = json.dumps(data)

        if not isinstance(dumped, utils.text):  # Python 2
            dumped = dumped.decode('utf-8')

        fp.write(dumped)

    expected = utils.read(path)

    assert expected == data
def test_utils_read(path):
    data = {'foo': 'bar'}

    with io.open(path, mode='wt', encoding='utf-8') as fp:
        dumped = json.dumps(data)

        if not isinstance(dumped, utils.text):  # Python 2
            dumped = dumped.decode('utf-8')

        fp.write(dumped)

    expected = utils.read(path)

    assert expected == data
Beispiel #3
0
def test_read():
    data = utils.read()

    check_dict(data)

    assert os.path.isfile(settings.DB)
Beispiel #4
0
def test_read():
    check_dict(utils.read(settings.DB))
Beispiel #5
0
def test_read():
    data = utils.read()

    check_dict(data)

    assert os.path.isfile(settings.DB)