Commit 6d5dee92 authored by Julien David's avatar Julien David
Browse files

Merge branch 'gitlab_ci' into 'master'

Gitlab ci

See merge request david/rdos!1
parents 236a2d4b 7236ef7c
image: alpine
stages:
- build
- test
job:build:
stage: build
script:
- apk update
- apk add python3
- apk add py-pip
- pip install pytest mysql-connector-python get_docker_secret docker
job:test:unit:
before_script:
- echo "Install Dependancies"
- apk update
- apk add python3
- apk add py-pip
- pip install pytest mysql-connector-python get_docker_secret docker
- echo "Start Tests"
script:
- cd tests
- pytest -v
after_script:
- echo "Tests have been done"
{
"test_mail.py": true
}
\ No newline at end of file
{}
\ No newline at end of file
[]
\ No newline at end of file
[
"test_mail.py::test_empty_mail",
"test_secret.py::test_empty_password",
"test_secret.py::test_unsecurred_password"
]
\ No newline at end of file
......@@ -11,8 +11,8 @@ import socket
socket.setdefaulttimeout(1.0)
def test_empty_mail():
assert ms.send_mail("","") == 0
assert ms.send_mail("","1234") == 0
assert ms.send_mail("","") == 0
assert ms.send_mail("","1234") == 0
assert ms.send_mail("julien.david@lipn.univ-paris13.fr","1234") == -1
#assert ms.send_mail("julien.david@lipn.univ-paris13.fr","1234") == -1
......@@ -4,14 +4,15 @@ import sys
sys.path.append(os.path.realpath('../softwares/'))
import database.database as db
@pytest.mark.secret_test
def secret_test():
def test_empty_password():
print("Empty password test")
with pytest.raises(db.NoPasswordDefineError):
db.get_password()
@pytest.mark.env_test
def env_test():
def test_unsecurred_password():
print("Unsecured password test")
os.environ['rdos_secret'] = "test"
assert db.get_password() == "test"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment