コード例 #1
0
def test_ws_accessors(wsdir):
    ws = workspace.Workspace(wsdir, create=True, add_defaults=True)
    assert ws.wsid != ''
    assert os.path.normpath(ws.root) == os.path.normpath(wsdir)
    _ = ws.name
    _ = ws.description
コード例 #2
0
def test_ws_init_create_defaults(wsdir):
    ws = workspace.Workspace(wsdir, create=True, add_defaults=True)
    # if defaults were set, then HTML documentation paths
    # will not be empty, so test this value
    assert ws.get_doc_paths() != []
コード例 #3
0
def test_ws_init_noconf(wsdir):
    with pytest.raises(errors.WorkspaceConfNotFoundError):
        workspace.Workspace(wsdir)
コード例 #4
0
def test_ws_init_badconf(wsdir):
    conf = open(os.path.join(wsdir, workspace.Workspace.WORKSPACE_CONFIG), 'w')
    conf.write('note: this config is wack\n')
    conf.close()
    with pytest.raises(errors.WorkspaceConfMissingField):
        workspace.Workspace(wsdir)
コード例 #5
0
def test_ws_init_notfound():
    with pytest.raises(errors.WorkspaceNotFoundError):
        workspace.Workspace(BADPATH)