Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdt4242-base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Rimolsrønning
tdt4242-base
Commits
27f18760
Commit
27f18760
authored
4 years ago
by
and
Browse files
Options
Downloads
Patches
Plain Diff
Reset Docstrings For Tests
parent
53a79ed1
No related branches found
No related tags found
1 merge request
!39
Removed Docstrings And Comments
Pipeline
#129193
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/secfit/tests/common.py
+2
-0
2 additions, 0 deletions
backend/secfit/tests/common.py
backend/secfit/tests/test_profile.py
+2
-0
2 additions, 0 deletions
backend/secfit/tests/test_profile.py
backend/secfit/tests/test_view_workout.py
+5
-0
5 additions, 0 deletions
backend/secfit/tests/test_view_workout.py
with
9 additions
and
0 deletions
backend/secfit/tests/common.py
+
2
−
0
View file @
27f18760
...
...
@@ -14,6 +14,8 @@ webdriver_path = os.environ.get("WEBDRIVER", "chromedriver")
class
Visibility
(
str
,
enum
.
Enum
):
"""
Enum representing workout visibility.
"""
PUBLIC
=
"
PU
"
COACH
=
"
CO
"
PRIVATE
=
"
PR
"
...
...
This diff is collapsed.
Click to expand it.
backend/secfit/tests/test_profile.py
+
2
−
0
View file @
27f18760
...
...
@@ -29,6 +29,7 @@ class ViewProfileTest(BlackBoxTestServer):
return
element
.
get_attribute
(
"
value
"
)
def
test_non_user_can_not_view_own_profile
(
self
):
"""
Test if a user is able to view their own public workout.
"""
self
.
get
(
"
profile.html
"
)
self
.
assertEqual
(
"
My Profile
"
,
self
.
driver
.
title
)
self
.
wait_until_value_not_empty
(
By
.
ID
,
"
username
"
)
...
...
@@ -40,6 +41,7 @@ class ViewProfileTest(BlackBoxTestServer):
self
.
assertEqual
(
email
,
""
)
def
test_user_can_view_own_profile
(
self
):
"""
Test if a user is able to view their own public workout.
"""
user
=
login_data
[
"
athlete
"
]
self
.
login
(
user
)
self
.
get
(
"
profile.html
"
)
...
...
This diff is collapsed.
Click to expand it.
backend/secfit/tests/test_view_workout.py
+
5
−
0
View file @
27f18760
...
...
@@ -52,6 +52,7 @@ class ViewWorkoutTest(BlackBoxTestServer):
return
element
.
get_attribute
(
"
value
"
)
def
test_user_can_view_own_public_workout
(
self
):
"""
Test if a user is able to view their own public workout.
"""
user
=
login_data
[
"
athlete
"
]
self
.
login
(
user
)
self
.
get
(
"
workout.html
"
,
id
=
1
)
...
...
@@ -67,6 +68,7 @@ class ViewWorkoutTest(BlackBoxTestServer):
self
.
assertEqual
(
value
,
Visibility
.
PUBLIC
)
def
test_coach_can_view_athletes_workout
(
self
):
"""
Test if a coach is able to view their athlete
'
s workout.
"""
user
=
login_data
[
"
coach
"
]
self
.
login
(
user
)
self
.
get
(
"
workout.html
"
,
id
=
2
)
...
...
@@ -81,6 +83,7 @@ class ViewWorkoutTest(BlackBoxTestServer):
self
.
assertEqual
(
value
,
Visibility
.
COACH
)
def
test_user_can_view_others_public_workout
(
self
):
"""
Test if a user is able to view another users
'
public workout.
"""
user
=
login_data
[
"
athlete
"
]
self
.
login
(
user
)
self
.
get
(
"
workout.html
"
,
id
=
3
)
...
...
@@ -95,6 +98,7 @@ class ViewWorkoutTest(BlackBoxTestServer):
self
.
assertEqual
(
value
,
Visibility
.
PUBLIC
)
def
test_user_can_view_own_private_workout
(
self
):
"""
Test if a user is able to view their own private workout.
"""
user
=
login_data
[
"
athlete
"
]
self
.
login
(
user
)
self
.
get
(
"
workout.html
"
,
id
=
4
)
...
...
@@ -109,6 +113,7 @@ class ViewWorkoutTest(BlackBoxTestServer):
self
.
assertEqual
(
value
,
Visibility
.
PRIVATE
)
def
test_user_cannot_view_other_users_private_workout
(
self
):
"""
Test if a user is unable to view another users
'
private workout.
"""
user
=
login_data
[
"
coach
"
]
self
.
login
(
user
)
self
.
get
(
"
workout.html
"
,
id
=
4
)
...
...
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