Skip to content

Commit

Permalink
Create additional checks for Cache-Control header (#5) (MDQ-161)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshafer authored Nov 26, 2018
1 parent 20da1a7 commit 2af9988
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion md-query.robot
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,27 @@ Variables variables.py
${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
4.2 Content Caching
[Tags] optional
# "Responders SHOULD include cache control information with successful
# (200 status code) responses, assuming the responder knows when
# retrieved metadata is meant to expire."
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Should Be Equal As Strings ${resp.status_code} 200
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Success response
# "When cache controls are used only the 'max-age' directive SHOULD be used."
${directive}= Get From Dictionary ${resp.headers} cache-control
Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used

# "The responder SHOULD also include cache control information with 404 Not
# Found responses. This allows the requester to create and maintain a
# negative-response cache."
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo
Should Be Equal As Strings ${resp.status_code} 404
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Not Found response
# "When cache controls are used only the 'max-age' directive SHOULD be used."
${directive}= Get From Dictionary ${resp.headers} cache-control
Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used

4.3 Content Compression
${resp}= Get Entity With Gzip baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Expand Down

0 comments on commit 2af9988

Please sign in to comment.