Пример #1
0
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))
Пример #2
0
    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]
Пример #3
0
    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)
Пример #4
0
    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)
Пример #5
0
def a_workspace():
    return Workspace(obj_id="123235", name="testworkspace")
Пример #6
0
def a_workspace():
    return Workspace(obj_id='123235', name='testworkspace')
Пример #7
0
def a_workspace(an_hourly_rate):
    return Workspace(obj_id='123235', name='testworkspace', hourly_rate=an_hourly_rate)