def test_basic(self): sot = secret.Secret() self.assertEqual('secret', sot.resource_key) self.assertEqual('secrets', sot.resources_key) self.assertEqual('/secrets', sot.base_path) self.assertEqual('keystore', sot.service.service_type) self.assertTrue(sot.allow_create) self.assertTrue(sot.allow_retrieve) self.assertTrue(sot.allow_update) self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list)
def test_make_it(self): sot = secret.Secret(EXAMPLE) self.assertEqual(EXAMPLE['algorithm'], sot.algorithm) self.assertEqual(EXAMPLE['bit_length'], sot.bit_length) self.assertEqual(EXAMPLE['content_types'], sot.content_types) self.assertEqual(EXAMPLE['expiration'], sot.expiration) self.assertEqual(EXAMPLE['mode'], sot.mode) self.assertEqual(EXAMPLE['name'], sot.name) self.assertEqual(EXAMPLE['secret_ref'], sot.secret_ref) self.assertEqual(EXAMPLE['status'], sot.status) self.assertEqual(EXAMPLE['updated'], sot.updated) self.assertEqual(EXAMPLE['secret_ref'], sot.id)
def update_secret(self, **data): return secret.Secret(data).update(self.session)
def get_secret(self, **data): return secret.Secret(data).get(self.session)
def delete_secret(self, **data): secret.Secret(data).delete(self.session)