mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-26 01:01:00 +00:00
Explicitly ignore add and remove messages for now
This commit is contained in:
parent
864b730164
commit
8835fdee6b
2 changed files with 34 additions and 0 deletions
28
tests/core/test_ld.py
Normal file
28
tests/core/test_ld.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from core.ld import parse_ld_date
|
||||||
|
|
||||||
|
|
||||||
|
def test_parse_ld_date():
|
||||||
|
"""
|
||||||
|
Tests that the various kinds of LD dates that we see will work
|
||||||
|
"""
|
||||||
|
assert parse_ld_date("2022-11-16T15:57:58Z") == datetime.datetime(
|
||||||
|
2022,
|
||||||
|
11,
|
||||||
|
16,
|
||||||
|
15,
|
||||||
|
57,
|
||||||
|
58,
|
||||||
|
tzinfo=datetime.timezone.utc,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert parse_ld_date("2022-11-16T15:57:58.123Z") == datetime.datetime(
|
||||||
|
2022,
|
||||||
|
11,
|
||||||
|
16,
|
||||||
|
15,
|
||||||
|
57,
|
||||||
|
58,
|
||||||
|
tzinfo=datetime.timezone.utc,
|
||||||
|
)
|
|
@ -79,6 +79,12 @@ class InboxMessageStates(StateGraph):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Cannot handle activity of type delete.{unknown}"
|
f"Cannot handle activity of type delete.{unknown}"
|
||||||
)
|
)
|
||||||
|
case "add":
|
||||||
|
# We are ignoring these right now (probably pinned items)
|
||||||
|
pass
|
||||||
|
case "remove":
|
||||||
|
# We are ignoring these right now (probably pinned items)
|
||||||
|
pass
|
||||||
case unknown:
|
case unknown:
|
||||||
raise ValueError(f"Cannot handle activity of type {unknown}")
|
raise ValueError(f"Cannot handle activity of type {unknown}")
|
||||||
return cls.processed
|
return cls.processed
|
||||||
|
|
Loading…
Reference in a new issue