Skip to content

Commit 9b16479

Browse files
Евгений БлиновЕвгений Блинов
authored andcommitted
+1 test
1 parent d6988e7 commit 9b16479

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/units/test_class_based.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ def patch(self, url):
3434
return lambda x: x
3535

3636

37+
class PseudoAppWithoutHTTPMethods:
38+
def __init__(self):
39+
self.calls = []
40+
41+
3742
def test_wrap_only_get():
3843
app = PseudoApp()
3944
wrapper = ClassBased(app)
@@ -73,3 +78,34 @@ def patch():
7378
pass
7479

7580
assert app.calls == [('get', url), ('post', url), ('put', url), ('delete', url), ('trace', url), ('head', url), ('options', url), ('connect', url), ('patch', url)]
81+
82+
83+
def test_wrap_something_which_is_not_supported_in_app():
84+
url = '/kek'
85+
app = PseudoAppWithoutHTTPMethods()
86+
wrapper = ClassBased(app)
87+
88+
@wrapper(url)
89+
class SomeItem:
90+
def get():
91+
pass
92+
def post():
93+
pass
94+
def put():
95+
pass
96+
def delete():
97+
pass
98+
def trace():
99+
pass
100+
def head():
101+
pass
102+
def options():
103+
pass
104+
def connect():
105+
pass
106+
def patch():
107+
pass
108+
def kek():
109+
pass
110+
111+
assert app.calls == []

0 commit comments

Comments
 (0)