Verified Commit 8d2620d0 authored by Robbert Bos's avatar Robbert Bos 🏗
Browse files

Update dataclass Workspace

parent 25409488
from dataclasses import dataclass, field
import datetime
from typing import Any, List, Dict
import uuid
from dataclasses import dataclass, field
from typing import Any, Dict, List
@dataclass
......@@ -140,14 +140,17 @@ class Variable:
@dataclass
class Workspace:
name: str
description: str
uuid: uuid.UUID
short_uuid: str
name: str
description: str
visibility: str
created_by: dict
permission: dict
is_member: bool
created: datetime.datetime
modified: datetime.datetime
url: str
def __str__(self):
return f"{self.name} {self.short_uuid}"
......
import unittest
import responses
from askanna.core.apiclient import client
......@@ -6,13 +7,57 @@ from askanna.core.workspace import WorkspaceGateway
a_sample_workspace_response = {
"uuid": "695fcc8b-ba8c-4575-a1e0-f0fcfc70a349",
"created": "2020-04-01T09:44:11.853000Z",
"modified": "2020-04-01T09:44:11.853000Z",
"short_uuid": "3Cpy-QMzd-MVko-1rDQ",
"name": "AskAnna",
"description": "",
"short_uuid": "3Cpy-QMzd-MVko-1rDQ",
"visibility": "PUBLIC",
"created_by": {
"uuid": "726f6262-6572-7440-6173-6b616e6e6121",
"short_uuid": "3Tw1-jp9H-FjQw-8PYY",
"name": "anna@askanna.io",
},
"permission": {
"askanna.me": False,
"askanna.admin": False,
"askanna.member": False,
"askanna.workspace.create": False,
"workspace.me.view": True,
"workspace.me.edit": True,
"workspace.me.remove": True,
"workspace.info.view": True,
"workspace.info.edit": True,
"workspace.remove": True,
"workspace.project.list": True,
"workspace.project.create": True,
"workspace.people.list": True,
"workspace.people.invite.create": True,
"workspace.people.invite.remove": True,
"workspace.people.invite.resend": True,
"workspace.people.edit": True,
"workspace.people.remove": True,
"project.me.view": True,
"project.info.view": True,
"project.info.edit": True,
"project.remove": True,
"project.code.list": True,
"project.code.create": True,
"project.job.list": True,
"project.job.create": True,
"project.job.edit": True,
"project.job.remove": True,
"project.variable.list": True,
"project.variable.create": True,
"project.variable.edit": True,
"project.variable.remove": True,
"project.run.list": True,
"project.run.create": True,
"project.run.edit": True,
"project.run.remove": True,
},
"is_member": True,
"created": "2020-04-01T09:44:11.853000Z",
"modified": "2020-04-01T09:44:11.853000Z",
"url": "http://beta.askanna.eu/3Cpy-QMzd-MVko-1rDQ/",
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment