diff options
Diffstat (limited to 'testing/web-platform/tests/tools/wptserve/wptserve/utils.py')
-rw-r--r-- | testing/web-platform/tests/tools/wptserve/wptserve/utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/utils.py b/testing/web-platform/tests/tools/wptserve/wptserve/utils.py new file mode 100644 index 000000000..e57ff196a --- /dev/null +++ b/testing/web-platform/tests/tools/wptserve/wptserve/utils.py @@ -0,0 +1,14 @@ +def invert_dict(dict): + rv = {} + for key, values in dict.iteritems(): + for value in values: + if value in rv: + raise ValueError + rv[value] = key + return rv + + +class HTTPException(Exception): + def __init__(self, code, message=""): + self.code = code + self.message = message |