コード例 #1
0
ファイル: test_db.py プロジェクト: rosstaylor/quantum
    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))
コード例 #2
0
ファイル: test_db.py プロジェクト: soheilhy/quantum
    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))
コード例 #3
0
ファイル: ofc_manager.py プロジェクト: Apsu/quantum
 def _exists_ofc_item(self, context, resource, quantum_id):
     return ndb.exists_ofc_item_lookup_both(context.session,
                                            resource, quantum_id)
コード例 #4
0
 def _exists_ofc_item(self, context, resource, quantum_id):
     return ndb.exists_ofc_item_lookup_both(context.session, resource,
                                            quantum_id)