def test_destroy(self): self.mox.StubOutWithMock(db, 'key_pair_destroy') db.key_pair_destroy(self.context, 'fake-user', 'foo-keypair') self.mox.ReplayAll() keypair_obj = keypair.KeyPair(context=self.context) keypair_obj.id = 123 keypair_obj.user_id = 'fake-user' keypair_obj.name = 'foo-keypair' keypair_obj.destroy()
def test_destroy_by_name(self): self.mox.StubOutWithMock(db, 'key_pair_destroy') db.key_pair_destroy(self.context, 'fake-user', 'foo-keypair') self.mox.ReplayAll() keypair.KeyPair.destroy_by_name(self.context, 'fake-user', 'foo-keypair')
def destroy(self): db.key_pair_destroy(self._context, self.user_id, self.name)
def destroy_by_name(cls, context, user_id, name): db.key_pair_destroy(context, user_id, name)