@@ -201,12 +201,24 @@ def testPostWithAttributes(self):
201201 rsp = self .session .post (req , data = json .dumps (payload ), headers = headers )
202202 self .assertEqual (rsp .status_code , 201 )
203203 rspJson = json .loads (rsp .text )
204- self .assertTrue (helper .validateId (rspJson ["id" ]))
204+ ctype_id = rspJson ["id" ]
205+ self .assertTrue (helper .validateId (ctype_id ))
205206 self .assertTrue ("type" in rspJson )
206207 type_json = rspJson ["type" ]
207208 self .assertEqual (type_json ["class" ], "H5T_FLOAT" )
208209 self .assertEqual (type_json ["base" ], "H5T_IEEE_F32LE" )
209- self .assertEqual (rspJson ["attributeCount" ], 4 )
210+ self .assertEqual (rspJson ["attributeCount" ], attr_count )
211+
212+ # fetch the attributes, check count
213+ req = f"{ helper .getEndpoint ()} /datatypes/{ ctype_id } /attributes"
214+ rsp = self .session .get (req , headers = headers )
215+ self .assertEqual (rsp .status_code , 200 )
216+ rspJson = json .loads (rsp .text )
217+ self .assertTrue ("hrefs" in rspJson )
218+ self .assertFalse ("type" in rspJson )
219+ self .assertFalse ("shape" in rspJson )
220+ self .assertTrue ("attributes" ) in rspJson
221+ self .assertEqual (len (rspJson ["attributes" ]), attr_count )
210222
211223 def testPostTypes (self ):
212224 # Test creation with all primitive types
0 commit comments