11from emannotationschemas .schemas .postsynaptic_compartment import SpineWithInfo
22
33good_spine_with_info = {
4- "position" : [100 , 200 , 300 ],
5- "supervoxel_id" : 50 ,
6- "root_id" : 10 ,
4+ "pt" : {"position" : [100 , 200 , 300 ], "supervoxel_id" : 50 , "root_id" : 10 },
75 "volume" : 1.5 ,
86 "n_inputs" : 3 ,
97}
1210def test_spine_with_info_schema ():
1311 schema = SpineWithInfo ()
1412 result = schema .load (good_spine_with_info )
15- assert result ["position" ] == [100 , 200 , 300 ]
16- assert result ["supervoxel_id" ] == 50
17- assert result ["root_id" ] == 10
13+ assert result ['pt' ][ "position" ] == [100 , 200 , 300 ]
14+ assert result ['pt' ][ "supervoxel_id" ] == 50
15+ assert result ['pt' ][ "root_id" ] == 10
1816 assert result ["volume" ] == 1.5
1917 assert result ["n_inputs" ] == 3
2018
@@ -23,13 +21,11 @@ def test_spine_with_info_optional():
2321 schema = SpineWithInfo ()
2422 result = schema .load (
2523 {
26- "position" : [100 , 200 , 300 ],
27- "supervoxel_id" : 50 ,
28- "root_id" : 10 ,
24+ "pt" : {"position" : [100 , 200 , 300 ], "supervoxel_id" : 50 , "root_id" : 10 },
2925 }
3026 )
31- assert result ["position" ] == [100 , 200 , 300 ]
32- assert result ["supervoxel_id" ] == 50
33- assert result ["root_id" ] == 10
27+ assert result ['pt' ][ "position" ] == [100 , 200 , 300 ]
28+ assert result ['pt' ][ "supervoxel_id" ] == 50
29+ assert result ['pt' ][ "root_id" ] == 10
3430 assert "volume" not in result
3531 assert "n_inputs" not in result
0 commit comments