Skip to content
Snippets Groups Projects
Commit 701a3615 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

editing tests

parent 9e0f66c2
No related branches found
No related tags found
1 merge request!5Adding json functions
Pipeline #687 failed
......@@ -4,3 +4,19 @@ softwares/server/.vscode/settings.json
softwares/database/__init__.py
softwares/database/.vscode/settings.json
tests/test_server.py
softwares/.vscode/settings.json
tests/.vscode/settings.json
.vscode/settings.json
softwares/__init__.py
softwares/__pycache__/__init__.cpython-38.pyc
softwares/server/__pycache__/__init__.cpython-38.pyc
softwares/server/__pycache__/server.cpython-38.pyc
tests/__init__.py
tests/.vscode/settings.json
tests/.vscode/settings.json
tests/__pycache__/test_secret.cpython-38-pytest-6.0.2.pyc
tests/.vscode/settings.json
tests/.vscode/settings.json
tests/__pycache__/__init__.cpython-38.pyc
tests/__pycache__/test_query_valid.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_mail.cpython-38-pytest-6.0.2.pyc
import os
import sys
import socket
sys.path.append(os.path.realpath('../softwares/'))
import mailer.mail_templates as ms
import mailer.mail_templates as ms # noqa E402
# ensures that the connection is timed out after 1 second (in cases the test is not
# launched on the proper network
import socket
socket.setdefaulttimeout(1.0)
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,8 +4,8 @@ import sys
import os
import pytest
import json
sys.path.append(os.path.realpath('../softwares/server'))
from softwares.server import server as serv # noqa E402
sys.path.append(os.path.realpath('../'))
from server import server as serv # noqa E402
data_test1 = '{"parameters":""}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment