Beispiel #1
0
    def test_exists_ofc_item(self):
        o, q, n = self.get_ofc_item_random_params()
        self.assertFalse(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))

        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        self.assertTrue(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))

        ndb.del_ofc_item(self.session, 'ofc_tenant', q)
        self.assertFalse(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))
Beispiel #2
0
    def test_exists_ofc_item(self):
        o, q, n = self.get_ofc_item_random_params()
        self.assertFalse(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))

        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        self.assertTrue(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))

        ndb.del_ofc_item(self.session, 'ofc_tenant', q)
        self.assertFalse(ndb.exists_ofc_item(self.session, 'ofc_tenant', q))
    def testb_exists_ofc_item(self):
        """test get OFC d."""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        ret = ndb.exists_ofc_item(self.session, 'ofc_tenant', q)
        self.assertTrue(ret)

        tenant_none = ndb.get_ofc_item(self.session, 'ofc_tenant', n)
        self.assertEqual(None, tenant_none)
Beispiel #4
0
    def testb_exists_ofc_item(self):
        """test get OFC d."""
        o, q, n = self.get_ofc_item_random_params()
        ndb.add_ofc_item(self.session, 'ofc_tenant', q, o)
        ret = ndb.exists_ofc_item(self.session, 'ofc_tenant', q)
        self.assertTrue(ret)

        tenant_none = ndb.get_ofc_item(self.session, 'ofc_tenant', n)
        self.assertEqual(None, tenant_none)
Beispiel #5
0
 def _exists_ofc_item(self, context, resource, neutron_id):
     return ndb.exists_ofc_item(context.session, resource, neutron_id)
Beispiel #6
0
 def _exists_ofc_item(self, context, resource, neutron_id):
     return ndb.exists_ofc_item(context.session, resource, neutron_id)