Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
376ec645
Commit
376ec645
authored
3 years ago
by
Victor Löfgren
Browse files
Options
Downloads
Patches
Plain Diff
Fix test_question_api
parent
e04a6398
No related branches found
No related tags found
1 merge request
!161
Resolve "replace-restx-with-smorest"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/tests/test_app.py
+1
-17
1 addition, 17 deletions
server/tests/test_app.py
with
1 addition
and
17 deletions
server/tests/test_app.py
+
1
−
17
View file @
376ec645
...
...
@@ -397,19 +397,7 @@ def test_question_api(client):
assert
response
.
status_code
==
http_codes
.
OK
headers
=
{
"
Authorization
"
:
"
Bearer
"
+
body
[
"
access_token
"
]}
# Get questions from empty competition
CID
=
1
# TODO: Fix api-calls so that the ones not using CID don't require one
slide_order
=
1
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
CID
}
/questions
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
assert
body
[
"
count
"
]
==
0
# Get questions from another competition that should have some questions
CID
=
3
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
CID
}
/questions
"
,
headers
=
headers
)
num_questions
=
3
assert
response
.
status_code
==
http_codes
.
OK
assert
body
[
"
count
"
]
==
num_questions
# Add question
name
=
"
Nytt namn
"
...
...
@@ -417,7 +405,7 @@ def test_question_api(client):
slide_order
=
6
response
,
item_question
=
post
(
client
,
f
"
/api/competitions/
{
CID
}
/slides/
{
slide_order
}
/questions
"
,
f
"
/api/competitions/
{
3
}
/slides/
{
slide_order
}
/questions
"
,
{
"
name
"
:
name
,
"
type_id
"
:
type_id
},
headers
=
headers
,
)
...
...
@@ -426,10 +414,6 @@ def test_question_api(client):
assert
item_question
[
"
type_id
"
]
==
type_id
num_questions
+=
1
# Checks number of questions
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
CID
}
/questions
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
assert
body
[
"
count
"
]
==
num_questions
"""
# Delete question
response, _ = delete(client, f
"
/api/competitions/{CID}/slides/{slide_order}/questions/{QID}
"
, headers=headers)
...
...
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