diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-10-27 09:55:59 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-10-27 09:55:59 +0300 |
commit | 84cc1ecbb12e5b192c981da31d21d002efc7fa7b (patch) | |
tree | 4e284ff652aab10469da4825d31152ef22c0503b | |
parent | 10fc89a290d4041bf159e4fe3f0a90150b77c282 (diff) | |
download | muck-poc-84cc1ecbb12e5b192c981da31d21d002efc7fa7b.tar.gz |
Add: must give method
-rw-r--r-- | muck/request.py | 1 | ||||
-rw-r--r-- | muck/request_tests.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/muck/request.py b/muck/request.py index b6207bf..2a04d79 100644 --- a/muck/request.py +++ b/muck/request.py @@ -16,6 +16,7 @@ class Request: def __init__(self, method=None): + assert method is not None self._method = method def method(self): diff --git a/muck/request_tests.py b/muck/request_tests.py index e0ab637..8bb9194 100644 --- a/muck/request_tests.py +++ b/muck/request_tests.py @@ -20,6 +20,10 @@ import muck class RequestTests(unittest.TestCase): + def test_init_fails_if_missing_args(self): + with self.assertRaises(AssertionError): + muck.Request() + def test_has_method(self): r = muck.Request(method='GET') self.assertEqual(r.method(), 'GET') |