mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-22 04:25:55 -04:00
parent
0b671be0c6
commit
ceedc0e448
@ -146,7 +146,7 @@ def test_timeline(mock_get, monkeypatch, capsys):
|
|||||||
|
|
||||||
assert "Frank Zappa 🎸" in lines[1]
|
assert "Frank Zappa 🎸" in lines[1]
|
||||||
assert "@fz" in lines[1]
|
assert "@fz" in lines[1]
|
||||||
assert "2017-04-12 17:53 CEST" in lines[1]
|
assert "2017-04-12 15:53 UTC" in lines[1]
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"The computer can't tell you the emotional story. It can give you the "
|
"The computer can't tell you the emotional story. It can give you the "
|
||||||
@ -187,7 +187,7 @@ def test_timeline_with_re(mock_get, monkeypatch, capsys):
|
|||||||
|
|
||||||
assert "Frank Zappa" in lines[1]
|
assert "Frank Zappa" in lines[1]
|
||||||
assert "@fz" in lines[1]
|
assert "@fz" in lines[1]
|
||||||
assert "2017-04-12 17:53 CEST" in lines[1]
|
assert "2017-04-12 15:53 UTC" in lines[1]
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
"The computer can't tell you the emotional story. It can give you the "
|
"The computer can't tell you the emotional story. It can give you the "
|
||||||
@ -566,21 +566,21 @@ def test_notifications(mock_get, capsys):
|
|||||||
"Frank Zappa @frank@zappa.social now follows you",
|
"Frank Zappa @frank@zappa.social now follows you",
|
||||||
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
||||||
"Dweezil Zappa @dweezil@zappa.social mentioned you in",
|
"Dweezil Zappa @dweezil@zappa.social mentioned you in",
|
||||||
"Dweezil Zappa @dweezil@zappa.social 2017-04-12 17:53 CEST",
|
"Dweezil Zappa @dweezil@zappa.social 2017-04-12 15:53 UTC",
|
||||||
"",
|
"",
|
||||||
"We still have fans in 2017 @fan123",
|
"We still have fans in 2017 @fan123",
|
||||||
"",
|
"",
|
||||||
"ID 111111111111111111 ",
|
"ID 111111111111111111 ",
|
||||||
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
||||||
"Terry Bozzio @terry@bozzio.social reblogged your status",
|
"Terry Bozzio @terry@bozzio.social reblogged your status",
|
||||||
"Zappa Fan @fan123@zappa-fans.social 1983-11-04 16:53 CET",
|
"Zappa Fan @fan123@zappa-fans.social 1983-11-04 15:53 UTC",
|
||||||
"",
|
"",
|
||||||
"The Black Page, a masterpiece",
|
"The Black Page, a masterpiece",
|
||||||
"",
|
"",
|
||||||
"ID 1234 ",
|
"ID 1234 ",
|
||||||
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
"────────────────────────────────────────────────────────────────────────────────────────────────────",
|
||||||
"Zappa Old Fan @fan9@zappa-fans.social favourited your status",
|
"Zappa Old Fan @fan9@zappa-fans.social favourited your status",
|
||||||
"Zappa Fan @fan123@zappa-fans.social 1983-11-04 16:53 CET",
|
"Zappa Fan @fan123@zappa-fans.social 1983-11-04 15:53 UTC",
|
||||||
"",
|
"",
|
||||||
"The Black Page, a masterpiece",
|
"The Black Page, a masterpiece",
|
||||||
"",
|
"",
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from html.parser import HTMLParser
|
from html.parser import HTMLParser
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -18,6 +19,11 @@ def parse_datetime(value):
|
|||||||
else:
|
else:
|
||||||
dttm = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z")
|
dttm = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f%z")
|
||||||
|
|
||||||
|
# When running tests return datetime in UTC so that tests don't depend on
|
||||||
|
# the local timezone
|
||||||
|
if "PYTEST_CURRENT_TEST" in os.environ:
|
||||||
|
return dttm.astimezone(timezone.utc)
|
||||||
|
|
||||||
return dttm.astimezone()
|
return dttm.astimezone()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user