@@ -117,11 +117,11 @@ def test_td_property_with_schema(
117
117
helpers , app , thing_description , app_ctx , schemas_path
118
118
):
119
119
class Index (View ):
120
+ schema = fields .Int (required = True )
121
+
120
122
def get (self ):
121
123
return "GET"
122
124
123
- Index .schema = fields .Int (required = True )
124
-
125
125
app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
126
126
rules = app .url_map ._rules_by_endpoint ["index" ]
127
127
@@ -151,11 +151,11 @@ def get(self):
151
151
152
152
def test_td_property_write_only (helpers , app , thing_description , app_ctx , schemas_path ):
153
153
class Index (View ):
154
+ schema = fields .Int ()
155
+
154
156
def put (self ):
155
157
return "PUT"
156
158
157
- Index .schema = fields .Int ()
158
-
159
159
app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
160
160
rules = app .url_map ._rules_by_endpoint ["index" ]
161
161
@@ -196,15 +196,15 @@ def test_td_property_different_response_type(
196
196
helpers , app , thing_description , app_ctx , schemas_path
197
197
):
198
198
class Index (View ):
199
+ schema = fields .Int ()
200
+ responses = {200 : {"content_type" : "text/plain; charset=us-ascii" }}
201
+
199
202
def get (self ):
200
203
return "GET"
201
204
202
205
def put (self ):
203
206
return "PUT"
204
207
205
- Index .schema = fields .Int ()
206
- Index .responses [200 ] = {"content_type" : "text/plain; charset=us-ascii" }
207
-
208
208
app .add_url_rule ("/" , view_func = Index .as_view ("index" ))
209
209
rules = app .url_map ._rules_by_endpoint ["index" ]
210
210
0 commit comments