Exemplo n.º 1
0
 def test_count_first_call_with_dirty_false(self):
     quota_api.set_quota_usage(
         self.context, self.resource, self.tenant_id, in_use=1)
     res = self._create_resource()
     self._add_data()
     # explicitly set dirty flag to False
     quota_api.set_all_quota_usage_dirty(
         self.context, self.resource, dirty=False)
     # Expect correct count to be returned anyway since the first call to
     # count() always resyncs with the db
     self.assertEqual(2, res.count(self.context, None, self.tenant_id))
Exemplo n.º 2
0
 def test_count_first_call_with_dirty_false(self):
     quota_api.set_quota_usage(
         self.context, self.resource, self.tenant_id, in_use=1)
     res = self._create_resource()
     self._add_data()
     # explicitly set dirty flag to False
     quota_api.set_all_quota_usage_dirty(
         self.context, self.resource, dirty=False)
     # Expect correct count to be returned anyway since the first call to
     # count() always resyncs with the db
     self.assertEqual(2, res.count(self.context, None, self.tenant_id))
Exemplo n.º 3
0
 def _test_set_all_quota_usage_dirty(self, expected):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     self.assertEqual(expected, quota_api.set_all_quota_usage_dirty(
         self.context, 'goals'))
Exemplo n.º 4
0
 def _test_set_all_quota_usage_dirty(self, expected):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     self.assertEqual(expected, quota_api.set_all_quota_usage_dirty(
         self.context, 'goals'))