Utilities¶
Miscellaneous methods, mainly used by other repositories.
- jscc.testing.util.http_get(url)[source]¶
Send and cache an HTTP GET request.
Attention
No timeout is set. If a user can input a malicious URL, the program can hang indefinitely.
- Parameters:
url (str) – the URL to request
- jscc.testing.util.http_head(url)[source]¶
Send and cache an HTTP HEAD request.
Attention
No timeout is set. If a user can input a malicious URL, the program can hang indefinitely.
- Parameters:
url (str) – the URL to request
- jscc.testing.util.difference(actual, expected)[source]¶
Return strings describing the differences between actual and expected sets.
Example:
>>> difference({1, 2, 3}, {3, 4, 5}) ('; added {1, 2}', '; removed {4, 5}') >>> difference({1}, {1}) ('', '')