From 10fc89a290d4041bf159e4fe3f0a90150b77c282 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 27 Oct 2018 09:54:32 +0300 Subject: Add: muck.Request --- muck/__init__.py | 2 ++ muck/request.py | 22 ++++++++++++++++++++++ muck/request_tests.py | 25 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 muck/request.py create mode 100644 muck/request_tests.py diff --git a/muck/__init__.py b/muck/__init__.py index a9e81e7..99b9869 100644 --- a/muck/__init__.py +++ b/muck/__init__.py @@ -26,3 +26,5 @@ from .pers import PersistentStore from .store import Store from .token import TokenChecker, create_token + +from .request import Request diff --git a/muck/request.py b/muck/request.py new file mode 100644 index 0000000..b6207bf --- /dev/null +++ b/muck/request.py @@ -0,0 +1,22 @@ +# Copyright (C) 2018 Lars Wirzenius +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +class Request: + + def __init__(self, method=None): + self._method = method + + def method(self): + return self._method diff --git a/muck/request_tests.py b/muck/request_tests.py new file mode 100644 index 0000000..e0ab637 --- /dev/null +++ b/muck/request_tests.py @@ -0,0 +1,25 @@ +# Copyright (C) 2018 Lars Wirzenius +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + + +import unittest + +import muck + + +class RequestTests(unittest.TestCase): + + def test_has_method(self): + r = muck.Request(method='GET') + self.assertEqual(r.method(), 'GET') -- cgit v1.2.1