forked from orbit-oss/flask
rewrite cli errors
consistent order for arguments to load functions refactor find_app_by_string to flow better more cli loader tests
This commit is contained in:
parent
8020d5eac9
commit
5436dddf64
3 changed files with 82 additions and 59 deletions
|
|
@ -200,6 +200,8 @@ def test_prepare_import(request, value, path, result):
|
|||
('cliapp.factory', 'create_app2("foo", "bar", )', 'app2_foo_bar'),
|
||||
# takes script_info
|
||||
('cliapp.factory', 'create_app3("foo")', 'app3_foo_spam'),
|
||||
# strip whitespace
|
||||
('cliapp.factory', ' create_app () ', 'app'),
|
||||
))
|
||||
def test_locate_app(test_apps, iname, aname, result):
|
||||
info = ScriptInfo()
|
||||
|
|
@ -213,12 +215,14 @@ def test_locate_app(test_apps, iname, aname, result):
|
|||
('cliapp.app', 'notanapp'),
|
||||
# not enough arguments
|
||||
('cliapp.factory', 'create_app2("foo")'),
|
||||
# invalid identifier
|
||||
('cliapp.factory', 'create_app('),
|
||||
# no app returned
|
||||
('cliapp.factory', 'no_app'),
|
||||
# nested import error
|
||||
('cliapp.importerrorapp', None),
|
||||
# not a Python file
|
||||
('cliapp.message.txt', None),
|
||||
# space before arg list
|
||||
('cliapp.factory', 'create_app ()'),
|
||||
))
|
||||
def test_locate_app_raises(test_apps, iname, aname):
|
||||
info = ScriptInfo()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue