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_invalid_path(tmpdir): with pytest.raises(OSError): filetree.path_hierarchy('invalid-path')
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('')