Merge "Make some tests more like Aodh tests"
This commit is contained in:
commit
1670d00a4b
@ -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",
|
||||
|
@ -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()
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user