Merge "Make some tests more like Aodh tests"

This commit is contained in:
Jenkins 2016-05-27 15:17:38 +00:00 committed by Gerrit Code Review
commit 1670d00a4b
3 changed files with 5 additions and 12 deletions

View File

@ -34,11 +34,11 @@ class TestAPIACL(v2.FunctionalTest):
return webtest.TestApp(app.load_app(conf=self.CONF))
def test_non_authenticated(self):
response = self.get_json('/meters', expect_errors=True)
response = self.get_json('/alarms', expect_errors=True)
self.assertEqual(401, response.status_int)
def test_authenticated_wrong_role(self):
response = self.get_json('/meters',
response = self.get_json('/alarms',
expect_errors=True,
headers={
"X-Roles": "Member",

View File

@ -35,13 +35,6 @@ class FakeComplexQuery(query.ValidatedComplexQuery):
metadata_allowed=metadata)
sample_name_mapping = {"resource": "resource_id",
"meter": "counter_name",
"type": "counter_type",
"unit": "counter_unit",
"volume": "counter_volume"}
class TestComplexQuery(base.BaseTestCase):
def setUp(self):
super(TestComplexQuery, self).setUp()

View File

@ -12,7 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Tests complex queries for samples
"""Tests complex queries for alarms
"""
import datetime
@ -165,8 +165,8 @@ class TestQueryAlarmsController(tests_api.FunctionalTest):
'{"=": {"project": "project-id2"}}'})
self.assertEqual(6, len(data.json))
for sample_item in data.json:
self.assertIn(sample_item['project_id'], set(["project-id2"]))
for alarm_item in data.json:
self.assertIn(alarm_item['project_id'], set(["project-id2"]))
def test_query_with_field_user_in_orderby(self):
data = self.post_json(self.alarm_url,