mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
timezone fix
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,9 @@ async def test_devtools_client_is_connected(devtools):
|
|||||||
assert devtools.is_connected
|
assert devtools.is_connected
|
||||||
|
|
||||||
|
|
||||||
@time_machine.travel(datetime.fromtimestamp(TIMESTAMP))
|
@time_machine.travel(datetime.utcfromtimestamp(TIMESTAMP))
|
||||||
async def test_devtools_log_places_encodes_and_queues_message(devtools):
|
async def test_devtools_log_places_encodes_and_queues_message(devtools):
|
||||||
|
|
||||||
await devtools._stop_log_queue_processing()
|
await devtools._stop_log_queue_processing()
|
||||||
devtools.log(DevtoolsLog("Hello, world!", CALLER))
|
devtools.log(DevtoolsLog("Hello, world!", CALLER))
|
||||||
queued_log = await devtools.log_queue.get()
|
queued_log = await devtools.log_queue.get()
|
||||||
@@ -38,7 +39,7 @@ async def test_devtools_log_places_encodes_and_queues_message(devtools):
|
|||||||
assert queued_log_data == {
|
assert queued_log_data == {
|
||||||
"type": "client_log",
|
"type": "client_log",
|
||||||
"payload": {
|
"payload": {
|
||||||
"timestamp": 1649170419,
|
"timestamp": 1649166819,
|
||||||
"path": "a/b/c.py",
|
"path": "a/b/c.py",
|
||||||
"line_number": 123,
|
"line_number": 123,
|
||||||
"segments": b"\x80\x04\x95B\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\rHello, world!\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
|
"segments": b"\x80\x04\x95B\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\rHello, world!\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
|
||||||
@@ -46,7 +47,7 @@ async def test_devtools_log_places_encodes_and_queues_message(devtools):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@time_machine.travel(datetime.fromtimestamp(TIMESTAMP))
|
@time_machine.travel(datetime.utcfromtimestamp(TIMESTAMP))
|
||||||
async def test_devtools_log_places_encodes_and_queues_many_logs_as_string(devtools):
|
async def test_devtools_log_places_encodes_and_queues_many_logs_as_string(devtools):
|
||||||
await devtools._stop_log_queue_processing()
|
await devtools._stop_log_queue_processing()
|
||||||
devtools.log(DevtoolsLog(("hello", "world"), CALLER))
|
devtools.log(DevtoolsLog(("hello", "world"), CALLER))
|
||||||
@@ -56,7 +57,7 @@ async def test_devtools_log_places_encodes_and_queues_many_logs_as_string(devtoo
|
|||||||
assert queued_log_data == {
|
assert queued_log_data == {
|
||||||
"type": "client_log",
|
"type": "client_log",
|
||||||
"payload": {
|
"payload": {
|
||||||
"timestamp": 1649170419,
|
"timestamp": 1649166819,
|
||||||
"path": "a/b/c.py",
|
"path": "a/b/c.py",
|
||||||
"line_number": 123,
|
"line_number": 123,
|
||||||
"segments": b"\x80\x04\x95@\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\x0bhello world\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
|
"segments": b"\x80\x04\x95@\x00\x00\x00\x00\x00\x00\x00]\x94(\x8c\x0crich.segment\x94\x8c\x07Segment\x94\x93\x94\x8c\x0bhello world\x94NN\x87\x94\x81\x94h\x03\x8c\x01\n\x94NN\x87\x94\x81\x94e.",
|
||||||
|
|||||||
Reference in New Issue
Block a user