This tester tests for the output of curl. User should provide a reference python dictionary whose key-value pair should be (header, op_value) for each line of the expected curl output. For header field, user should provide a string that matches case-insensitively the expected header. For op_value field, which performs comparison operations against the actual value corresponding to that header, use can provide one of the following inputs:
To use the CurlHeader tester when writing tests, which is not one of the default testers, user should invoke the tester in the following way:
Examples:
To check for header ‘X-Cache’ that have value ‘miss’ and header ‘cache-control’ that have value starting with ‘max’, provide the following dictionary to tester:
{ 'X-Cache' : 'miss', 'cache-control' : {'equal_re' : 'max.*'} }
To check for header ‘Age’ that can have any value and header ‘etag’ that have value either matching ‘myetag’ or end with ‘p’, provide the following dictionary to tester:
{ 'Age' : None, 'etag' : { 'equal' : 'myetag', 'equal_re' : '.*p' } }