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
c467fe68
Commit
c467fe68
authored
3 years ago
by
Victor Löfgren
Browse files
Options
Downloads
Patches
Plain Diff
Fix test_competition_api test
parent
ccf29469
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
+8
-8
8 additions, 8 deletions
server/tests/test_app.py
with
8 additions
and
8 deletions
server/tests/test_app.py
+
8
−
8
View file @
c467fe68
...
...
@@ -112,7 +112,7 @@ def test_competition_api(client):
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
competition_id
}
/slides
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
assert
len
(
body
[
"
items
"
]
)
==
2
assert
len
(
body
)
==
2
"""
response, body = put(client, f
"
/api/competitions/{competition_id}/slides/{2}/order
"
, {
"
order
"
: 1}, headers=headers)
...
...
@@ -124,11 +124,11 @@ def test_competition_api(client):
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
competition_id
}
/teams
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
assert
len
(
body
[
"
items
"
]
)
==
1
assert
body
[
"
items
"
][
0
][
"
name
"
]
==
"
t1
"
assert
len
(
body
)
==
1
assert
body
[
0
][
"
name
"
]
==
"
t1
"
response
,
body
=
delete
(
client
,
f
"
/api/competitions/
{
competition_id
}
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
response
,
body
=
delete
(
client
,
f
"
/api/competitions/
{
competition_id
}
"
,
headers
=
head
q
ers
)
assert
response
.
status_code
==
http_codes
.
NO_CONTENT
# Get competition
competition_id
=
2
...
...
@@ -203,7 +203,7 @@ def test_auth_and_user_api(client):
assert
body
[
"
count
"
]
==
1
# Get user from ID
searched_user
=
body
[
"
items
"
][
0
]
searched_user
=
body
[
0
]
user_id
=
searched_user
[
"
id
"
]
response
,
body
=
get
(
client
,
f
"
/api/users/
{
user_id
}
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
...
...
@@ -339,8 +339,8 @@ def test_slide_api(client):
response
,
body
=
get
(
client
,
f
"
/api/competitions/
{
CID
}
/slides
"
,
headers
=
headers
)
assert
response
.
status_code
==
http_codes
.
OK
assert
body
[
"
count
"
]
==
3
assert
body
[
"
items
"
][
0
][
"
id
"
]
==
3
assert
body
[
"
items
"
][
0
][
"
order
"
]
==
0
assert
body
[
0
][
"
id
"
]
==
3
assert
body
[
0
][
"
order
"
]
==
0
slide_id
=
3
"""
...
...
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