@@ -206,11 +206,35 @@ def test_list_roles_exception(self):
206206 def test_create_token (self ):
207207 secret_id = self .uuidv4 ()
208208 accessor_id = self .uuidv4 ()
209- result = self .consul .acl .create_create_token (
209+ result = self .consul .acl .create_token (
210210 accessor_id = accessor_id ,
211211 secret_id = secret_id ,
212212 roles = ROLELINKS_SAMPLE ,
213213 policies = POLICYLINKS_SAMPLE ,
214214 service_identities = SERVICE_IDENTITIES_SAMPLE )
215215 self .assertEqual (result ['AccessorID' ], accessor_id )
216216 self .assertEqual (result ['SecretID' ], secret_id )
217+
218+ def test_create_and_read_token (self ):
219+ secret_id = self .uuidv4 ()
220+ accessor_id = self .uuidv4 ()
221+ value = self .consul .acl .create_token (
222+ accessor_id = accessor_id ,
223+ secret_id = secret_id ,
224+ roles = ROLELINKS_SAMPLE ,
225+ policies = POLICYLINKS_SAMPLE ,
226+ service_identities = SERVICE_IDENTITIES_SAMPLE )
227+ result = self .consul .acl .read_token (value ["AccessorID" ])
228+ self .assertEqual (result ['AccessorID' ], accessor_id )
229+
230+ def test_create_and_delete_token (self ):
231+ secret_id = self .uuidv4 ()
232+ accessor_id = self .uuidv4 ()
233+ value = self .consul .acl .create_token (
234+ accessor_id = accessor_id ,
235+ secret_id = secret_id ,
236+ roles = ROLELINKS_SAMPLE ,
237+ policies = POLICYLINKS_SAMPLE ,
238+ service_identities = SERVICE_IDENTITIES_SAMPLE )
239+ result = self .consul .acl .delete_token (value ["AccessorID" ])
240+ self .assertTrue (result )
0 commit comments