Tuneup gabbi transformedids.yaml file to modern standards

Make use of METHOD: /url shorthand to make the request method more
visible and more tightly associated with the url for easier reading.

Use $LAST_URL to refer to the URL of the previous request, but only
when the sameness of the URL is a relevant part of the expression of
the tests-in-sequence. (That is, don't just use LAST_URL because the
URL is the same.)

Change-Id: I1a86fcf07faa65f2e554c7278841abcd8870f2c5
This commit is contained in:
zhangguoqing 2016-05-26 07:23:02 +00:00
parent 8381f9444f
commit 72c8b5f4a7
1 changed files with 12 additions and 19 deletions

View File

@ -20,8 +20,7 @@ tests:
- name: create archive policy
desc: for later use
url: /v1/archive_policy
method: POST
POST: /v1/archive_policy
request_headers:
x-roles: admin
data:
@ -32,8 +31,7 @@ tests:
# Check transformed uuids across the URL hierarchy
- name: post new resource non uuid
url: /v1/resource/generic
method: post
POST: /v1/resource/generic
data:
id: generic one
user_id: 0fbb231484614b1a80131fc22f6afc9c
@ -50,18 +48,17 @@ tests:
location: /v1/resource/generic/[a-f0-9-]{36}/
- name: get new non uuid resource by external id
url: /v1/resource/generic/generic%20one
GET: /v1/resource/generic/generic%20one
response_json_paths:
$.id: $RESPONSE['$.id']
- name: get new non uuid resource by internal id
url: /v1/resource/generic/$RESPONSE['$.id']
GET: /v1/resource/generic/$RESPONSE['$.id']
response_json_paths:
$.id: $RESPONSE['$.id']
- name: patch by external id
url: /v1/resource/generic/generic%20one
method: PATCH
PATCH: /v1/resource/generic/generic%20one
data:
metrics:
cattle:
@ -71,18 +68,17 @@ tests:
- '"cattle"'
- name: list metric by external resource id
url: /v1/resource/generic/generic%20one/metric
GET: /v1/resource/generic/generic%20one/metric
response_json_paths:
$[0].name: cattle
- name: list empty measures by external resource id
url: /v1/resource/generic/generic%20one/metric/cattle/measures
GET: /v1/resource/generic/generic%20one/metric/cattle/measures
response_json_paths:
$: []
- name: post measures by external resource id
url: /v1/resource/generic/generic%20one/metric/cattle/measures
method: POST
POST: /v1/resource/generic/generic%20one/metric/cattle/measures
data:
- timestamp: "2015-03-06T14:33:57"
value: 43.1
@ -91,7 +87,7 @@ tests:
status: 202
- name: list two measures by external resource id
url: /v1/resource/generic/generic%20one/metric/cattle/measures
GET: $LAST_URL
poll:
count: 10
delay: 1
@ -100,15 +96,13 @@ tests:
$[1][2]: 12
- name: delete the resource by external id
url: /v1/resource/generic/generic%20one
method: DELETE
DELETE: /v1/resource/generic/generic%20one
status: 204
# Check length handling
- name: fail to post too long non uuid resource id
url: /v1/resource/generic
method: post
POST: /v1/resource/generic
data:
id: four score and seven years ago we the people of the United States of America i have a dream it is the courage to continue that counts four score and seven years ago we the people of the United States of America i have a dream it is the courage to continue that counts four score and seven years ago we the people of the United States of America i have a dream it is the courage to continue that counts
user_id: 0fbb231484614b1a80131fc22f6afc9c
@ -121,8 +115,7 @@ tests:
- not a valid value for
- name: post long non uuid resource id
url: /v1/resource/generic
method: post
POST: $LAST_URL
data:
# 255 char string
id: four score and seven years ago we the people of the United States of America i have a dream it is the courage to continue that counts four score and seven years ago we the people of the United States of America i have a dream it is the courage to continue