@@ -189,38 +189,40 @@ def test_spot_to_checkin_from_featurecollection(self, api_client):
189189 assert resp .status_code == 200
190190
191191 out = resp .json ()
192- assert isinstance (out , list )
193- assert len (out ) == 1
192+ assert isinstance (out , dict )
194193
195- c = out [0 ]
196- # Rockd checkin-ish keys
194+ c = out
197195 assert c ["checkin_id" ] == 10
198196 assert c ["spot_id" ] == 10
199197 assert c ["lat" ] == pytest .approx (43.0 )
200198 assert c ["lng" ] == pytest .approx (- 89.0 )
199+
201200 assert "created" in c and isinstance (c ["created" ], str )
202- assert "added" in c and isinstance (c ["added" ], str )
203- assert "observations" in c and isinstance (c ["observations" ], list )
201+ assert "updated" in c and isinstance (c ["updated" ], str )
202+ assert c ["created" ].endswith ("Z" )
203+ assert c ["updated" ].endswith ("Z" )
204204
205- # orientation passed through
205+ assert "observations" in c and isinstance ( c [ "observations" ], list )
206206 assert len (c ["observations" ]) == 1
207207 assert "orientation" in c ["observations" ][0 ]
208208 assert c ["observations" ][0 ]["orientation" ]["strike" ] == pytest .approx (123.0 )
209209 assert c ["observations" ][0 ]["orientation" ]["dip" ] == pytest .approx (45.0 )
210210
211+
211212 def test_spot_to_checkin_accepts_single_fieldsite_dict (self , api_client ):
212213 # your spot_to_checkin treats dict with "location" as already-FieldSite-shaped
213214 payload = _fieldsite_dict (fs_id = 501 )
214215 resp = api_client .post (
215216 "/dev/convert/field-site?in=spot&out=checkin" , json = payload
216217 )
217218 assert resp .status_code == 200
218-
219219 out = resp .json ()
220- assert isinstance (out , list )
221- assert len (out ) == 1
222- assert out [0 ]["checkin_id" ] == 501
223- assert out [0 ]["spot_id" ] == 501
220+ assert isinstance (out , dict )
221+ assert out ["checkin_id" ] == 501
222+ assert out ["spot_id" ] == 501
223+ assert "created" in out and isinstance (out ["created" ], str )
224+ assert "updated" in out and isinstance (out ["updated" ], str )
225+
224226
225227 def test_checkin_to_fieldsite_single (self , api_client ):
226228 payload = _checkin (checkin_id = 77 )
@@ -262,29 +264,29 @@ def test_fieldsite_to_checkin_list(self, api_client):
262264 "/dev/convert/field-site?in=fieldsite&out=checkin" , json = payload
263265 )
264266 assert resp .status_code == 200
265-
266267 out = resp .json ()
267268 assert isinstance (out , list )
268269 assert len (out ) == 2
269-
270270 c0 = out [0 ]
271271 assert c0 ["checkin_id" ] == 900
272272 assert c0 ["spot_id" ] == 900
273273 assert "created" in c0 and isinstance (c0 ["created" ], str )
274- assert "added" in c0 and isinstance (c0 ["added" ], str )
274+ assert "updated" in c0 and isinstance (c0 ["updated" ], str )
275+
275276
276277 def test_fieldsite_to_checkin_single_returns_list_of_one (self , api_client ):
277278 payload = _fieldsite_dict (fs_id = 999 )
278279 resp = api_client .post (
279280 "/dev/convert/field-site?in=fieldsite&out=checkin" , json = payload
280281 )
281282 assert resp .status_code == 200
282-
283283 out = resp .json ()
284- assert isinstance (out , list )
285- assert len (out ) == 1
286- assert out [0 ]["checkin_id" ] == 999
287- assert out [0 ]["spot_id" ] == 999
284+ assert isinstance (out , dict )
285+ assert out ["checkin_id" ] == 999
286+ assert out ["spot_id" ] == 999
287+ assert "created" in out and isinstance (out ["created" ], str )
288+ assert "updated" in out and isinstance (out ["updated" ], str )
289+
288290
289291 def test_fieldsite_to_spot_single (self , api_client ):
290292 payload = _fieldsite_dict (fs_id = 1234 )
0 commit comments