Skip to content
Permalink
Browse files

Fix conditional retrieval

  • Loading branch information
dshafer committed Oct 30, 2018
1 parent 5ee1eca commit 9508c4c014fd588ea964369ee1cae674b08b477b
Showing with 11 additions and 3 deletions.
  1. +9 −2 MDQ.robot
  2. +2 −1 md-query.robot
@@ -10,13 +10,20 @@ Get All Entities

Get Entity
[Arguments] ${baseUrl} ${identifier}
Create Session alias=md url=${baseUrl} debug=1
Create Session alias=md url=${baseUrl}
${resp}= Get Request alias=md uri=/entities/${identifier}
[Return] ${resp}

Get Entity With Gzip
[Arguments] ${baseUrl} ${identifier}
Create Session alias=md url=${baseUrl}
&{headers}= Create Dictionary Accept-Encoding=gzip
${resp}= Get Request alias=md uri=entities/${identifier} headers=&{headers}
${resp}= Get Request alias=md uri=entities/${identifier} headers=${headers}
[Return] ${resp}

Conditional Get Entity
[Arguments] ${baseUrl} ${identifier} ${etag}
&{headers}= Create Dictionary If-None-Match=${etag}
Create Session alias=md url=${baseUrl}
${resp}= Get Request alias=md uri=/entities/${identifier} headers=${headers}
[Return] ${resp}
@@ -46,8 +46,9 @@ Variables variables.py

4.1 Conditional Retrieval
[Tags] optional
Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
${etag}= Get From Dictionary ${resp.headers} ETag
${resp}= Conditional Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED} etag=${etag}
Should Be Equal As Strings ${resp.status_code} 304 msg=SHOULD return HTTP status code 304

# 4.2 Content Caching

0 comments on commit 9508c4c

Please sign in to comment.
You can’t perform that action at this time.