def _check_exists_ofc_item(self, mode, exp_new, exp_old): o, q, n = self.get_ofc_item_random_params() self._check_new_old_item(ndb.exists_ofc_item, q, False, False) self.assertFalse(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q)) ndb.add_ofc_item(self.session, "ofc_tenant", q, o, mode) self._check_new_old_item(ndb.exists_ofc_item, q, exp_new, exp_old) self.assertTrue(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q)) ndb.del_ofc_item(self.session, "ofc_tenant", q, mode) self._check_new_old_item(ndb.exists_ofc_item, q, False, False) self.assertFalse(ndb.exists_ofc_item_lookup_both(self.session, "ofc_tenant", q))
def _check_exists_ofc_item(self, mode, exp_new, exp_old): o, q, n = self.get_ofc_item_random_params() self._check_new_old_item(ndb.exists_ofc_item, q, False, False) self.assertFalse(ndb.exists_ofc_item_lookup_both( self.session, 'ofc_tenant', q)) ndb.add_ofc_item(self.session, 'ofc_tenant', q, o, mode) self._check_new_old_item(ndb.exists_ofc_item, q, exp_new, exp_old) self.assertTrue(ndb.exists_ofc_item_lookup_both( self.session, 'ofc_tenant', q)) ndb.del_ofc_item(self.session, 'ofc_tenant', q, mode) self._check_new_old_item(ndb.exists_ofc_item, q, False, False) self.assertFalse(ndb.exists_ofc_item_lookup_both( self.session, 'ofc_tenant', q))
def _exists_ofc_item(self, context, resource, quantum_id): return ndb.exists_ofc_item_lookup_both(context.session, resource, quantum_id)