@@ -35,9 +35,11 @@ def test_misskey_person(test_data_path: Path):
3535 assert isinstance (actor .attachment [0 ], PropertyValue )
3636
3737 # check extra value
38- assert actor ._misskey_summary == "Hello"
38+ assert actor .model_extra is not None
39+ assert actor .model_extra .get ("_misskey_summary" ) == "Hello"
3940
4041 # check apmodel methods
42+ assert actor .public_key is not None
4143 assert isinstance (actor .public_key .public_key , RSAPublicKey )
4244
4345
@@ -84,14 +86,17 @@ def test_fedibird_person(test_data_path: Path):
8486 assert isinstance (actor .attachment [0 ], PropertyValue )
8587
8688 # check extra value
89+ assert actor .model_extra is not None
8790 assert actor .model_extra .get ("vcard:Address" ) == "Earth"
88- assert isinstance (actor .otherSetting , list )
91+ assert isinstance (actor .model_extra .get ("otherSetting" ), list )
92+ searchable_by = actor .model_extra .get ("searchableBy" )
8993 assert (
90- isinstance (actor . searchableBy , list )
91- and actor . searchableBy [0 ] == "https://fedibird.example.com/users/user"
94+ isinstance (searchable_by , list )
95+ and searchable_by [0 ] == "https://fedibird.example.com/users/user"
9296 )
9397
9498 # check apmodel methods
99+ assert actor .public_key is not None
95100 assert isinstance (actor .public_key .public_key , RSAPublicKey )
96101
97102
@@ -107,8 +112,9 @@ def test_akkoma_actor(test_data_path: Path):
107112 assert actor .name == "User"
108113 assert actor .summary == "Hello"
109114 assert isinstance (actor .endpoints , ActorEndpoints )
115+ assert actor .endpoints .model_extra is not None
110116 assert (
111- actor .endpoints .oauthAuthorizationEndpoint
117+ actor .endpoints .model_extra . get ( " oauthAuthorizationEndpoint" )
112118 == "https://akkoma.example.com/oauth/authorize"
113119 )
114120
@@ -124,7 +130,8 @@ def test_akkoma_note(test_data_path: Path):
124130 note .id
125131 == "https://akkoma.example.com/objects/bcd39b5c-004f-4897-81b1-2b7a4caa398b"
126132 )
127- assert note .sensitive is True
133+ assert note .model_extra is not None
134+ assert note .model_extra .get ("sensitive" ) is True
128135 assert note .summary == "test"
129136 assert note .content == "<p>:blobthumbsup: 👀</p>"
130137
@@ -149,6 +156,7 @@ def test_mastodon_actor(test_data_path: Path):
149156 assert actor .endpoints .shared_inbox == "https://mastodon.example.com/inbox"
150157 assert actor .discoverable is True
151158 assert actor .indexable is True
159+ assert actor .public_key is not None
152160 assert isinstance (actor .public_key .public_key , RSAPublicKey )
153161 assert actor .public_key .id == "https://mastodon.example.com/users/user#main-key"
154162 assert actor .public_key .owner == "https://mastodon.example.com/users/user"
@@ -168,15 +176,16 @@ def test_mastodon_note(test_data_path: Path):
168176 == "https://mastodon.example.com/users/user/statuses/2002577998669970637"
169177 )
170178 assert note .content == "<p>Hello!</p>"
171- assert note .sensitive is False
179+ assert note .model_extra is not None
180+ assert note .model_extra .get ("sensitive" ) is False
172181 assert note .attributed_to == "https://mastodon.example.com/users/user"
173182 assert isinstance (note .replies , Collection )
174183 assert isinstance (note .likes , Collection )
175184 assert isinstance (note .shares , Collection )
176185
177186
178187def test_akkoma_replies (test_data_path : Path ):
179- from apmodel .core .collection import OrderedCollection
188+ from apmodel .core .collection import OrderedCollection , OrderedCollectionPage
180189
181190 data_loc = test_data_path / "akkoma_replies.json"
182191 with open (data_loc , "r" ) as f :
@@ -186,4 +195,5 @@ def test_akkoma_replies(test_data_path: Path):
186195 assert isinstance (replies , OrderedCollection )
187196 assert replies .total_items == 1
188197 assert replies .first is not None
198+ assert isinstance (replies .first , OrderedCollectionPage )
189199 assert replies .first .type == "OrderedCollectionPage"
0 commit comments