Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sams-classes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
coding-at-fu
sams-classes
Commits
8a62408a
Commit
8a62408a
authored
Jun 14, 2017
by
Sebastian Lobinger
Browse files
Options
Downloads
Patches
Plain Diff
extend test_app_with_view in test_sams_app.py to reflect issue
#21
parent
6d53c50e
No related branches found
No related tags found
1 merge request
!16
Resolve "Unterstützung von anderen HTTP-Methoden als GET innerhalb einer APP"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_sams_app.py
+19
-6
19 additions, 6 deletions
test/test_sams_app.py
with
19 additions
and
6 deletions
test/test_sams_app.py
+
19
−
6
View file @
8a62408a
...
@@ -60,18 +60,31 @@ class TestSAMSApp(unittest.TestCase):
...
@@ -60,18 +60,31 @@ class TestSAMSApp(unittest.TestCase):
manifest
=
{
manifest
=
{
'
default_language
'
:
'
en
'
'
default_language
'
:
'
en
'
,
'
views
'
:
[
,
'
views
'
:
[
{
'
url
'
:
'
test/do_nothing
'
{
'
url
'
:
'
test/do_nothing
'
,
,
'
function
'
:
'
views.do_nothing
'
}
'
function
'
:
'
views.do_nothing
'
,
'
methods
'
:
[
'
GET
'
,
'
POST
'
,
'
DELETE
'
,
'
PUT
'
,
'
UPDATE
'
,
'
HEADER
'
,
'
PATCH
'
]
}
]
]
}
}
app
=
SAMSApp
(
name
=
'
test
'
,
manifest
=
manifest
app
=
SAMSApp
(
name
=
'
test
'
,
manifest
=
manifest
,
langDict
=
{
'
en
'
:{}})
,
langDict
=
{
'
en
'
:{}})
flaskApp
=
Flask
(
__name__
)
flaskApp
=
Flask
(
__name__
)
flaskApp
.
register_blueprint
(
app
.
blueprint
)
flaskApp
.
register_blueprint
(
app
.
blueprint
)
with
self
.
subTest
(
'
test url_map
'
):
self
.
assertGreater
(
len
(
list
(
flaskApp
.
url_map
.
iter_rules
())),
1
)
self
.
assertGreater
(
len
(
list
(
flaskApp
.
url_map
.
iter_rules
())),
1
)
client
=
flaskApp
.
test_client
(
self
)
thApp
=
FlaskInThread
(
flaskApp
,
host
=
"
localhost
"
,
port
=
5000
)
response
=
client
.
get
(
'
/test/do_nothing
'
)
thApp
.
start
()
time
.
sleep
(
0.01
)
for
method
in
manifest
[
'
views
'
][
0
][
'
methods
'
]:
with
self
.
subTest
(
method
):
response
=
requests
.
request
(
method
=
method
,
url
=
'
http://localhost:5000/test/do_nothing
'
)
self
.
assertIs
(
response
.
status_code
,
200
)
self
.
assertIs
(
response
.
status_code
,
200
)
requests
.
request
(
method
=
'
GET
'
,
url
=
'
http://localhost:5000/shutdown
'
)
time
.
sleep
(
0.01
)
def
test_app_lang
(
self
):
def
test_app_lang
(
self
):
"""
App.lang(language) returns dict with requested language / default.
"""
"""
App.lang(language) returns dict with requested language / default.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment