Support Python 3.10 (#107)

* Support Python 3.10

* Add timeout

* Fix test
This commit is contained in:
Michaël Arnauts 2022-10-16 15:36:00 +02:00 committed by GitHub
parent 9f4bba446a
commit 98a0ffb162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 7 deletions

View File

@ -15,17 +15,19 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ ubuntu-latest ] os: [ ubuntu-latest ]
python-version: [ 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 ] python-version: [ "2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10" ]
include: include:
# Kodi Leia on Windows uses a bundled Python 2.7. # Kodi Leia on Windows uses a bundled Python 2.7.
- os: windows-latest - os: windows-latest
python-version: 2.7 python-version: "2.7"
# Kodi Matrix on Windows uses a bundled Python 3.8, but we test 3.9 also to be sure. # Kodi Matrix on Windows uses a bundled Python 3.8, but we test 3.9 and 3.10 also to be sure.
- os: windows-latest - os: windows-latest
python-version: 3.8 python-version: "3.8"
- os: windows-latest - os: windows-latest
python-version: 3.9 python-version: "3.9"
- os: windows-latest
python-version: "3.10"
steps: steps:
- name: Check out ${{ github.sha }} from repository ${{ github.repository }} - name: Check out ${{ github.sha }} from repository ${{ github.repository }}
uses: actions/checkout@v2 uses: actions/checkout@v2

View File

@ -125,7 +125,7 @@ class KodiPlayer(Player):
if not self.av_started: if not self.av_started:
# Check stream path # Check stream path
import requests import requests
response = requests.get(self.stream_path) response = requests.get(self.stream_path, timeout=5)
if response.status_code == 403: if response.status_code == 403:
message_id = 30720 message_id = 30720
else: else:

View File

@ -75,7 +75,7 @@ class TestApi(unittest.TestCase):
@unittest.skipUnless(kodiutils.get_setting('username') and kodiutils.get_setting('password'), 'Skipping since we have no credentials.') @unittest.skipUnless(kodiutils.get_setting('username') and kodiutils.get_setting('password'), 'Skipping since we have no credentials.')
def test_get_drm_stream(self): def test_get_drm_stream(self):
resolved_stream = self._api.get_stream_by_uuid('b74882b7-7b19-4bfe-9773-22d8ce474aa5') # https://www.goplay.be/video/ncis-los-angeles/ncis-los-angeles-s3/ncis-los-angeles-s3-aflevering-3 resolved_stream = self._api.get_stream_by_uuid('62e04ab5-1f3c-4385-ad7a-e2943ddb1849') # https://www.goplay.be/video/ncis-los-angeles/ncis-los-angeles-s10/ncis-los-angeles-s10-aflevering-12
self.assertIsInstance(resolved_stream, ResolvedStream) self.assertIsInstance(resolved_stream, ResolvedStream)