mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-15 01:32:57 -07:00
Update cherrypy==18.9.0
This commit is contained in:
parent
2fc618c01f
commit
51196a7fb1
137 changed files with 44442 additions and 11582 deletions
|
@ -1,5 +1,6 @@
|
|||
"""Basic tests for the CherryPy core: request handling."""
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
|
||||
from cheroot.test import webtest
|
||||
|
@ -197,6 +198,33 @@ def test_custom_log_format(log_tracker, monkeypatch, server):
|
|||
)
|
||||
|
||||
|
||||
def test_utc_in_timez(monkeypatch):
|
||||
"""Test that ``LazyRfc3339UtcTime`` is rendered as ``str`` using UTC timestamp."""
|
||||
utcoffset8_local_time_in_naive_utc = (
|
||||
datetime.datetime(
|
||||
year=2020,
|
||||
month=1,
|
||||
day=1,
|
||||
hour=1,
|
||||
minute=23,
|
||||
second=45,
|
||||
tzinfo=datetime.timezone(datetime.timedelta(hours=8)),
|
||||
)
|
||||
.astimezone(datetime.timezone.utc)
|
||||
.replace(tzinfo=None)
|
||||
)
|
||||
|
||||
class mock_datetime:
|
||||
@classmethod
|
||||
def utcnow(cls):
|
||||
return utcoffset8_local_time_in_naive_utc
|
||||
|
||||
monkeypatch.setattr('datetime.datetime', mock_datetime)
|
||||
rfc3339_utc_time = str(cherrypy._cplogging.LazyRfc3339UtcTime())
|
||||
expected_time = '2019-12-31T17:23:45Z'
|
||||
assert rfc3339_utc_time == expected_time
|
||||
|
||||
|
||||
def test_timez_log_format(log_tracker, monkeypatch, server):
|
||||
"""Test a customized access_log_format string, which is a
|
||||
feature of _cplogging.LogManager.access()."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue