summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-10-27 09:54:32 +0300
committerLars Wirzenius <liw@liw.fi>2018-10-27 09:54:32 +0300
commit10fc89a290d4041bf159e4fe3f0a90150b77c282 (patch)
treee1b4a863ff533e225d4c3cddf09762cc46bbd24e
parent2d76d3425b2c58957d9317110bd09974e07706bb (diff)
downloadmuck-poc-10fc89a290d4041bf159e4fe3f0a90150b77c282.tar.gz
Add: muck.Request
-rw-r--r--muck/__init__.py2
-rw-r--r--muck/request.py22
-rw-r--r--muck/request_tests.py25
3 files changed, 49 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
+
+
+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 <http://www.gnu.org/licenses/>.
+
+
+import unittest
+
+import muck
+
+
+class RequestTests(unittest.TestCase):
+
+ def test_has_method(self):
+ r = muck.Request(method='GET')
+ self.assertEqual(r.method(), 'GET')