Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDD97-web-programming
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Anton Hansson
TDDD97-web-programming
Commits
4aa3a4ec
"srv/TSTExecutorCost.srv" did not exist on "5aa790a0446bccae364ff957a6ce08d1486fa7d5"
Commit
4aa3a4ec
authored
2 years ago
by
Anton Hansson
Browse files
Options
Downloads
Patches
Plain Diff
Update tests/test_router.py, .gitlab-ci.yml
parent
2177bf55
No related branches found
No related tags found
No related merge requests found
Pipeline
#76566
failed
2 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+16
-7
16 additions, 7 deletions
.gitlab-ci.yml
tests/test_router.py
+10
-11
10 additions, 11 deletions
tests/test_router.py
with
26 additions
and
18 deletions
.gitlab-ci.yml
+
16
−
7
View file @
4aa3a4ec
run_tests
:
stage
:
test
image
:
python:3.9
before_script
:
-
pip install -r requirements.txt
script
:
-
python -m unittest discover tests
image
:
"
python:3.7"
before_script
:
-
python --version
-
pip install -r requirements.txt
stages
:
-
Static Analysis
-
Test
...
pytest
:
stage
:
Test
script
:
-
pytest
This diff is collapsed.
Click to expand it.
tests/test_router.py
+
10
−
11
View file @
4aa3a4ec
import
unittest
def
test_uppercase
():
assert
"
loud noises
"
.
upper
()
==
"
LOUD NOISES
"
class
TestSum
(
unittest
.
TestCase
):
def
test_list_int
(
self
):
"""
Test that it can sum a list of integers
"""
data
=
[
1
,
2
,
3
]
result
=
sum
(
data
)
self
.
assertEqual
(
result
,
6
)
def
test_reversed
():
assert
list
(
reversed
([
1
,
2
,
3
,
4
]))
==
[
4
,
3
,
2
,
1
]
if
__name__
==
'
__main__
'
:
unittest
.
main
()
def
test_some_primes
():
assert
37
in
{
num
for
num
in
range
(
2
,
50
)
if
not
any
(
num
%
div
==
0
for
div
in
range
(
2
,
num
))
}
\ No newline at end of file
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