33from urllib .parse import quote_plus
44
55import pytest
6- from datetime import datetime , timedelta
6+ from datetime import datetime
77from PIL import Image
88from plexapi .exceptions import BadRequest , NotFound
99from plexapi .server import PlexServer
10- from plexapi .utils import download , setDatetimeTimezone , DATETIME_TIMEZONE
10+ from plexapi .utils import download
1111from requests import Session
1212
1313from . import conftest as utils
@@ -32,36 +32,6 @@ def test_server_attr(plex, account):
3232 assert len (plex .version ) >= 5
3333
3434
35- def test_server_updatedAt_timezone (plex ):
36- original = DATETIME_TIMEZONE
37- try :
38- # no timezone configured, should be naive
39- setDatetimeTimezone (False )
40- plex .reload ()
41- dt_naive = plex .updatedAt
42- assert dt_naive .tzinfo is None
43-
44- # local timezone configured, should be aware
45- setDatetimeTimezone (True )
46- plex .reload ()
47- dt_local = plex .updatedAt
48- assert dt_local .tzinfo is not None
49-
50- # explicit IANA zones. Check that the offset is correct too
51- setDatetimeTimezone ("UTC" )
52- plex .reload ()
53- dt : datetime = plex .updatedAt
54- assert dt .tzinfo is not None
55- assert dt .tzinfo .utcoffset (dt ) == timedelta (0 )
56- setDatetimeTimezone ("Asia/Dubai" )
57- plex .reload ()
58- dt : datetime = plex .updatedAt
59- assert dt .tzinfo is not None
60- assert dt .tzinfo .utcoffset (dt ) == timedelta (hours = 4 )
61- finally : # Restore for other tests
62- setDatetimeTimezone (original )
63-
64-
6535def test_server_alert_listener (plex , movies ):
6636 try :
6737 messages = []
0 commit comments