Merge "fix undefined variable"

This commit is contained in:
Jenkins 2013-04-23 13:38:46 +00:00 committed by Gerrit Code Review
commit dfe3d12d28
2 changed files with 7 additions and 1 deletions

View File

@ -68,7 +68,7 @@ class Trust(kvs.Base, trust.Driver):
try:
ref = self.db.get('trust-%s' % trust_id)
except exception.NotFound:
raise exception.TrustNotFound(token_id=token_id)
raise exception.TrustNotFound(trust_id=trust_id)
ref['deleted'] = True
self.db.set('trust-%s' % trust_id, ref)

View File

@ -2139,6 +2139,12 @@ class TrustTests(object):
self.trust_api.delete_trust(trust_id)
self.assertIsNone(self.trust_api.get_trust(trust_id))
def test_delete_trust_not_found(self):
trust_id = uuid.uuid4().hex
self.assertRaises(exception.TrustNotFound,
self.trust_api.delete_trust,
trust_id)
def test_get_trust(self):
new_id = uuid.uuid4().hex
trust_data = self.create_sample_trust(new_id)