Esempio n. 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
Esempio n. 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
Esempio n. 3
0
def test_read():
    data = utils.read()

    check_dict(data)

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

    check_dict(data)

    assert os.path.isfile(settings.DB)