Skip to content
Snippets Groups Projects
Commit 4aa3a4ec authored by Anton Hansson's avatar Anton Hansson :ghost:
Browse files

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
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment