Repository: swappsco/toggl-python-api-client (language: python)

Issue:
Update base URL for Toggl API



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000..d92c4d0
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,52 @@
+name: "Code scanning - action"
+
+on:
+  push:
+  pull_request:
+  schedule:
+    - cron: '0 13 * * 2'
+
+jobs:
+  CodeQL-Build:
+
+    # CodeQL runs on ubuntu-latest and windows-latest
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v2
+      with:
+        # We must fetch at least the immediate parents so that if this is
+        # a pull request then we can checkout the head.
+        fetch-depth: 2
+
+    # If this run was triggered by a pull request event, then checkout
+    # the head of the pull request instead of the merge commit.
+    - run: git checkout HEAD^2
+      if: ${{ github.event_name == 'pull_request' }}
+      
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v1
+      # Override language selection by uncommenting this and choosing your languages
+      # with:
+      #   languages: go, javascript, csharp, python, cpp, java
+
+    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild@v1
+
+    # ℹ️ Command-line programs to run using the OS shell.
+    # 📚 https://git.io/JvXDl
+
+    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+    #    and modify them (or add more) to build your code if your project
+    #    uses a compiled language
+
+    #- run: |
+    #   make bootstrap
+    #   make release
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze@v1
diff --git a/toggl/api_client.py b/toggl/api_client.py
index 0f89226..636717e 100644
--- a/toggl/api_client.py
+++ b/toggl/api_client.py
@@ -6,9 +6,9 @@ class TogglClientApi(object):
     defaultCredentials = {
         "username": "",
         "workspace_name": "",
-        "base_url": "https://www.toggl.com/api",
+        "base_url": "https://api.track.toggl.com/api",
         "ver_api": 8,
-        "base_url_report": "https://toggl.com/reports/api",
+        "base_url_report": "https://api.track.toggl.com/reports/api",
         "ver_report": 2,
     }
     credentials = {}


Test patch:
diff --git a/tests/tests_live.py b/tests/tests_live.py
index b2d71e4..ad106ae 100644
--- a/tests/tests_live.py
+++ b/tests/tests_live.py
@@ -23,7 +23,7 @@ def test_api_client_instance_created(self):
         self.assertNotEqual(self.api, None)
 
     def test_valid_toggl_base_url(self):
-        self.assertEqual(self.api.api_base_url, "https://www.toggl.com/api/v8")
+        self.assertEqual(self.api.api_base_url, "https://api.track.toggl.com/api/v8")
 
     def test_api_toggl_auth_check_response_ok(self):
         response = self.api.query("/me")