Skip to content
Snippets Groups Projects
Commit 0c15a78b authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

correct connection error handling syntax in tests

parent ee986a29
Branches
Tags
1 merge request!22prepare for v1.0.5
Pipeline #42981 passed
...@@ -3,7 +3,7 @@ iPPI-DB unit tests ...@@ -3,7 +3,7 @@ iPPI-DB unit tests
""" """
import json import json
import re import re
import requests.exceptions.SSLError from requests.exceptions import SSLError
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.core.management import call_command from django.core.management import call_command
...@@ -773,7 +773,7 @@ class TestConvertSMILESToIUPAC(TestCase): ...@@ -773,7 +773,7 @@ class TestConvertSMILESToIUPAC(TestCase):
self.assertEqual( self.assertEqual(
convert_smiles_to_iupac(smiles).lower(), expected_iupac.lower() convert_smiles_to_iupac(smiles).lower(), expected_iupac.lower()
) )
except requests.exceptions.SSLError: except SSLError:
self.skipTest("SSL connection issue with the CACTUS WS, skipping") self.skipTest("SSL connection issue with the CACTUS WS, skipping")
......
""" """
iPPI-DB contribution module tests iPPI-DB contribution module tests
""" """
import requests.exceptions.HTTPError from requests.exceptions import HTTPError
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
...@@ -26,7 +26,7 @@ class BibliographyIDTestCase(TestCase): ...@@ -26,7 +26,7 @@ class BibliographyIDTestCase(TestCase):
b.id_source = "10.1016/j.bmcl.2013.03.013" b.id_source = "10.1016/j.bmcl.2013.03.013"
try: try:
b.save(autofill=True) b.save(autofill=True)
except requests.exceptions.HTTPError: except HTTPError:
self.skipTest("Connection error, skipping test") self.skipTest("Connection error, skipping test")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment