Example #1
0
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
Example #2
0
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
Example #3
0
def test_read():
    data = utils.read()

    check_dict(data)

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

    check_dict(data)

    assert os.path.isfile(settings.DB)