aodh/ceilometer/tests/gabbi/gabbits/resources-empty.yaml
Chris Dent 4647acca8e Add gabbi tests for resources
These test for appopriate HTTP behavior. Two different files are
used: one without any resources established by fixture and one which
uses the SampleDataFixture to make sure there is one resource.

Future gabbi tests for resources should explore authorization
handling (RBAC) and more complex query scenarios (with larger data
sets).

Change-Id: I95b4ed684f663912c29da3d48102631f4d0dd4df
2015-03-17 14:07:57 +00:00

60 lines
1.4 KiB
YAML

#
# Explore and cover resources API with gabbi tests when there are no
# resources.
#
fixtures:
- ConfigFixture
tests:
# Check for a list of resources, modifying the request in various
# ways.
- name: list resources no extra
desc: Provide no additional header guidelines
url: /v2/resources
response_headers:
content-type: /application/json/
response_strings:
- "[]"
- name: list resources but get url wrong
url: /v2/resrces
status: 404
- name: list resources explicit accept
url: /v2/resources
request_headers:
accept: application/json
response_strings:
- "[]"
- name: list resources bad accept
url: /v2/resources
request_headers:
accept: text/plain
status: 406
- name: list resources with bad query field
url: /v2/resources?q.field=id&q.value=cars
status: 400
response_strings:
- unrecognized field in query
- name: list resources with query
url: /v2/resources?q.field=resource&q.value=cars
response_strings:
- "[]"
- name: list resource bad type meter links
url: /v2/resources?meter_links=yes%20please
status: 400
response_strings:
- unable to convert to int
- name: list resource meter links int
url: /v2/resources?meter_links=0
response_strings:
- "[]"