示例#1
0
def test_path_hierarchy(tmpdir):
    uid = uuid1()
    tmp = tmpdir.mkdir('{}'.format(uid))
    data = filetree.path_hierarchy(tmp.strpath)
    assert json.dumps(data)
    for key in ['type', 'name', 'path']:
        assert key in data
def test_path_hierarchy(tmpdir):
    uid = uuid1()
    tmp = tmpdir.mkdir('{}'.format(uid))
    data = filetree.path_hierarchy(tmp.strpath)
    assert json.dumps(data)
    for key in ['type', 'name', 'path']:
        assert key in data
示例#3
0
def test_path_hierarchy_invalid_path(tmpdir):
    with pytest.raises(OSError):
        filetree.path_hierarchy('invalid-path')
示例#4
0
def test_path_hierarchy_invalid_path_none(tmpdir):
    with pytest.raises(AssertionError):
        filetree.path_hierarchy(None)
def test_path_hierarchy_invalid_path_empty_path(tmpdir):
    with pytest.raises(OSError):
        filetree.path_hierarchy('')
def test_path_hierarchy_invalid_path_none(tmpdir):
    with pytest.raises(AssertionError):
        filetree.path_hierarchy(None)