Utilities#

Miscellaneous methods, mainly used by other repositories.

jscc.testing.util.http_get(url)[source]#

Sends and caches an HTTP GET request.

Parameters:

url (str) – the URL to request

jscc.testing.util.http_head(url)[source]#

Sends and caches an HTTP HEAD request.

Parameters:

url (str) – the URL to request

jscc.testing.util.difference(actual, expected)[source]#

Returns 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})
('', '')
Parameters:
  • actual (set) – the actual set

  • expected (set) – the expected set

jscc.testing.util.warn_and_assert(paths, warn_message, assert_message)[source]#

If paths isn’t empty, issues a warning for each path, and raises an assertion error.

Parameters:
  • paths (list) – file paths

  • warn_message (str) – the format string for the warning message

  • assert_message (str) – the error message for the assert statement