File tree Expand file tree Collapse file tree 5 files changed +55
-4
lines changed Expand file tree Collapse file tree 5 files changed +55
-4
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,16 @@ language: python
3
3
env :
4
4
global :
5
5
- MOST_TESTED_PYTHON_VERSION=2.7
6
- - FLASK_LATEST=0.10.1
6
+ - COVERAGE_PYTHON_VERSION=3.5
7
+ - FLASK_LATEST=0.11.1
7
8
- GH_REPO="teracyhq/flask-classful"
8
9
- secure : WP/pK+Hcm7s3992sy6atnm+znXal6ZipVe4GIv90E71CqxhUG/dv6h+C4V4w48LEbDuW19tt6y5EOUeyoBl1bIAaIruBgJAyvQsi8PO6rAhnqQmfkPTnjfoOjHuWXO8dyFrQFhl9R2P/BxSmrYb/HFVhrjMHqwe0JnfSpwyDqjVN1xFYkg81fCjXnQA60uCY8TNPSnwkUb1w1vKG7Aot46uMJk1aWUmWFlDRBfQaqhw2y2KK/G4xB0t9UL4lRl66xER4iXjkYuGQEAik5OVKnpPf9IZRUDMUdPCdxzsbbw6qdrNls5FhvNhfz/PN+65l3Ui3eRQZs74Yw2eOI77pUUQ/6oYdbwm346cyrS33GiHWwvylQHsKdTIGf2C4AlyUAYzOIMmuNHaKuWSgt++czxEQQKfoNRp7Zthru0PuPS0Y9M3G2AsbiX05XpNL+qbhvnRzE/TYiTUoqKpB9TrTDF5FX6wLsgluHxroU27Tu2i5iB+DkNDeDCv1oZFnY3VZQd5rH8hu5BA6r5SWfe4VrUoTXABNAniCWvVZLu+zfY/kYcbd/RY8Tcm914I2TDU3tZa0rPjZl90y5NjoNJyu4+3mO3xUg/1fOWsTmdSW3EsLC0VqzJeSJTi9xX6zy62twcvGxivlgW2fippEZ6azboHJQHAjKS2PyUn//+MFRzk=
9
10
matrix :
10
11
- Flask=0.9.0
11
12
- Flask=0.10.0
12
13
- Flask=0.10.1
14
+ - Flask=0.11
15
+ - Flask=0.11.1
13
16
matrix :
14
17
exclude :
15
18
- python : 3.3
@@ -41,7 +44,7 @@ after_script:
41
44
- if [[ ! -z ${DEPLOY_HTML_DIR+x} && $TRAVIS_PYTHON_VERSION == $MOST_TESTED_PYTHON_VERSION && $Flask == $FLASK_LATEST ]]; then
42
45
pip install -r docs/requirements.txt && cd docs && make setup_gh_pages && make generate && make deploy; fi
43
46
after_success :
44
- - if [[ $TRAVIS_PYTHON_VERSION == $MOST_TESTED_PYTHON_VERSION && $Flask == $FLASK_LATEST ]]; then pip install
47
+ - if [[ $TRAVIS_PYTHON_VERSION == $COVERAGE_PYTHON_VERSION && $Flask == $FLASK_LATEST ]]; then pip install
45
48
--quiet python-coveralls && make report-coverage && coveralls; fi
46
49
- make check-style
47
50
notifications :
Original file line number Diff line number Diff line change @@ -357,7 +357,11 @@ def get_interesting_members(base_class, cls):
357
357
def get_true_argspec (method ):
358
358
"""Drills through layers of decorators attempting to locate the actual argspec for the method."""
359
359
360
- argspec = inspect .getargspec (method )
360
+ try :
361
+ argspec = inspect .getargspec (method )
362
+ except ValueError :
363
+ argspec = inspect .getfullargspec (method )
364
+
361
365
args = argspec [0 ]
362
366
if args and args [0 ] == 'self' :
363
367
return argspec
Original file line number Diff line number Diff line change
1
+ [nosetests]
2
+ where =test_classful
3
+ py3where =.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def find_version(*file_paths):
37
37
url = 'https://github.com/teracyhq/flask-classful' ,
38
38
license = 'BSD' ,
39
39
author = 'Freedom Dumlao & Teracy, Inc' ,
40
- author_email = 'teracyhq @teracy.com' ,
40
+ author_email = 'hq @teracy.com' ,
41
41
description = 'Class based views for Flask' ,
42
42
long_description = __doc__ ,
43
43
py_modules = ['flask_classful' ],
Original file line number Diff line number Diff line change
1
+ import sys
2
+
3
+ import json
4
+ from flask import Flask
5
+ from flask_classful import FlaskView , route
6
+ from nose .tools import *
7
+
8
+
9
+ # python3 only
10
+
11
+ class TypingView (FlaskView ):
12
+
13
+ def index (self ):
14
+ return "Index"
15
+
16
+ @route ('/<id>' , methods = ['POST' ])
17
+ def post (self , id : str ) -> str :
18
+ return "Post"
19
+
20
+ def patch (self , id : str ) -> str :
21
+ return "Patch"
22
+
23
+
24
+ app = Flask ('typing-app' )
25
+ TypingView .register (app )
26
+ client = app .test_client ()
27
+
28
+
29
+ def test_index ():
30
+ resp = client .get ('/typing/' )
31
+ eq_ (b"Index" , resp .data )
32
+
33
+
34
+ def test_post ():
35
+ resp = client .post ('/typing/123' )
36
+ eq_ (b"Post" , resp .data )
37
+
38
+
39
+ def test_patch ():
40
+ resp = client .patch ('/typing/123' )
41
+ eq_ (b"Patch" , resp .data )
You can’t perform that action at this time.
0 commit comments