def test_str(a_date): """Getting coverage up""" str(User(obj_id="123", name="test")) str(Project(obj_id="123", name="test")) str(ProjectStub(obj_id="123")) str(Workspace(obj_id="123", name="test")) str(APIObject(obj_id="123")) str(NamedAPIObject(obj_id="123", name="test")) str(TimeEntry(obj_id="123", start=a_date))
def get_workspaces(self, api_key) -> List[Workspace]: """Get all workspaces for the given api key Parameters ---------- api_key: str Clockify Api key Returns ------- List[Workspace]""" response = self.api_server.get(path="/workspaces", api_key=api_key) return [Workspace.init_from_dict(x) for x in response]
def make_workspace(self, api_key, workspace_name) -> Workspace: """Post and create in Clockify workspace using workspace name with the given api key Parameters ---------- api_key: str Clockify Api key workspace_name: str The name of the workspace to be created Returns ------- Workspace """ response = self.api_server.post(path="/workspaces", api_key=api_key, data={"name": workspace_name}) return Workspace.init_from_dict(response)
def make_project(self, api_key: str, project_name: str, client: Client = None, additional_data: {str: str} = None) -> Project: """Post and create in Clockify project using project name with the given api key, for the given workspace Parameters ---------- api_key: str Clockify Api key project_name: str The name of the workspace to be created Returns ------- Project """ response = self.api_server.post(path="/workspaces", api_key=api_key, data={"name": workspace_name}) return Workspace.init_from_dict(response)
def a_workspace(): return Workspace(obj_id="123235", name="testworkspace")
def a_workspace(): return Workspace(obj_id='123235', name='testworkspace')
def a_workspace(an_hourly_rate): return Workspace(obj_id='123235', name='testworkspace', hourly_rate=an_hourly_rate)