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
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() != []
def test_ws_init_noconf(wsdir): with pytest.raises(errors.WorkspaceConfNotFoundError): workspace.Workspace(wsdir)
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)
def test_ws_init_notfound(): with pytest.raises(errors.WorkspaceNotFoundError): workspace.Workspace(BADPATH)