Пример #1
0
 def test_get_quota_usage_by_resource(self):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('assists', 11)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     usage_infos = quota_api.get_quota_usage_by_resource(
         self.context, 'goals')
     # 2 results expected in admin context
     self.assertEqual(2, len(usage_infos))
     for usage_info in usage_infos:
         self.assertEqual('goals', usage_info.resource)
Пример #2
0
 def test_get_quota_usage_by_resource(self):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('assists', 11)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     usage_infos = quota_api.get_quota_usage_by_resource(
         self.context, 'goals')
     # 2 results expected in admin context
     self.assertEqual(2, len(usage_infos))
     for usage_info in usage_infos:
         self.assertEqual('goals', usage_info.resource)
Пример #3
0
 def test_get_quota_usage_by_resource(self):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('assists', 11)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     usage_infos = quota_api.get_quota_usage_by_resource(
         self.context, 'goals')
     # Only 1 result expected in tenant context
     self.assertEqual(1, len(usage_infos))
     self._verify_quota_usage(usage_infos[0],
                              expected_resource='goals',
                              expected_used=26)
Пример #4
0
 def test_get_quota_usage_by_resource(self):
     self._create_quota_usage('goals', 26)
     self._create_quota_usage('assists', 11)
     self._create_quota_usage('goals', 12, tenant_id='Callejon')
     usage_infos = quota_api.get_quota_usage_by_resource(
         self.context, 'goals')
     # Only 1 result expected in tenant context
     self.assertEqual(1, len(usage_infos))
     self._verify_quota_usage(usage_infos[0],
                              expected_resource='goals',
                              expected_used=26)