Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions tests/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@


def test_static_endpoints():
assert Endpoints.WORKSPACES == "https://www.toggl.com/api/v8/workspaces"
assert Endpoints.CLIENTS == "https://www.toggl.com/api/v8/clients"
assert Endpoints.PROJECTS == "https://www.toggl.com/api/v8/projects"
assert Endpoints.REPORT_DETAILED == "https://toggl.com/reports/api/v2/details"
assert Endpoints.REPORT_SUMMARY == "https://toggl.com/reports/api/v2/summary"
assert Endpoints.START_TIME == "https://www.toggl.com/api/v8/time_entries/start"
assert Endpoints.TIME_ENTRIES == "https://www.toggl.com/api/v8/time_entries"
assert Endpoints.WORKSPACES == "https://api.track.toggl.com/api/v8/workspaces"
assert Endpoints.CLIENTS == "https://api.track.toggl.com/api/v8/clients"
assert Endpoints.PROJECTS == "https://api.track.toggl.com/api/v8/projects"
assert Endpoints.REPORT_DETAILED == "https://api.track.toggl.com/reports/api/v2/details"
assert Endpoints.REPORT_SUMMARY == "https://api.track.toggl.com/reports/api/v2/summary"
assert Endpoints.START_TIME == "https://api.track.toggl.com/api/v8/time_entries/start"
assert Endpoints.TIME_ENTRIES == "https://api.track.toggl.com/api/v8/time_entries"
assert (
Endpoints.CURRENT_RUNNING_TIME
== "https://www.toggl.com/api/v8/time_entries/current"
== "https://api.track.toggl.com/api/v8/time_entries/current"
)
assert Endpoints.REPORT_WEEKLY == "https://toggl.com/reports/api/v2/weekly"
assert Endpoints.REPORT_WEEKLY == "https://api.track.toggl.com/reports/api/v2/weekly"


def test_stop_time():
assert Endpoints.STOP_TIME(1) == "https://www.toggl.com/api/v8/time_entries/1/stop"
assert Endpoints.STOP_TIME(1) == "https://api.track.toggl.com/api/v8/time_entries/1/stop"


def test_workspacde_projects():
assert (
Endpoints.WORKSPACE_PROJECTS(1)
== "https://www.toggl.com/api/v8/workspaces/1/projects"
== "https://api.track.toggl.com/api/v8/workspaces/1/projects"
)


def test_client_projects():
assert (
Endpoints.CLIENT_PROJECTS(1)
== "https://www.toggl.com/api/v8/clients/1/projects"
== "https://api.track.toggl.com/api/v8/clients/1/projects"
)
8 changes: 4 additions & 4 deletions toggl/endpoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
V8_BASE_URL = "https://www.toggl.com/api/v8"
V8_BASE_URL = "https://api.track.toggl.com/api/v8"


class Endpoints(object):
Expand All @@ -7,12 +7,12 @@ class Endpoints(object):
WORKSPACES = f"{V8_BASE_URL}/workspaces"
CLIENTS = f"{V8_BASE_URL}/clients"
PROJECTS = f"{V8_BASE_URL}/projects"
REPORT_DETAILED = "https://toggl.com/reports/api/v2/details"
REPORT_SUMMARY = "https://toggl.com/reports/api/v2/summary"
REPORT_DETAILED = "https://api.track.toggl.com/reports/api/v2/details"
REPORT_SUMMARY = "https://api.track.toggl.com/reports/api/v2/summary"
START_TIME = f"{V8_BASE_URL}/time_entries/start"
TIME_ENTRIES = f"{V8_BASE_URL}/time_entries"
CURRENT_RUNNING_TIME = f"{V8_BASE_URL}/time_entries/current"
REPORT_WEEKLY = "https://toggl.com/reports/api/v2/weekly"
REPORT_WEEKLY = "https://api.track.toggl.com/reports/api/v2/weekly"

@staticmethod
def STOP_TIME(pid):
Expand Down