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

adjust test of convert_iupac_to_smiles_and_inchi web service

the format of the returned json has slightly changed, see below, therefore
we are now testing the values returned in the json

before:

```json
{
  'inchi': 'InChI=1/C7H5N3O6/c1-4-6(9(13)14)2-5(8(11)12)3-7(4)10(15)16/h2-3H,1H3',
  'smiles': '[N+](=O)([O-])C1=C(C)C(=CC(=C1)[N+](=O)[O-])[N+](=O)[O-]',
  'stdinchi': 'InChI=1S/C7H5N3O6/c1-4-6(9(13)14)2-5(8(11)12)3-7(4)10(15)16/h2-3H,1H3',
  'stdinchikey': 'SPSSULHKWOKEEL-UHFFFAOYSA-N'
}
```

after:

```json
{
  'inchi': 'InChI=1/C7H5N3O6/c1-4-6(9(13)14)2-5(8(11)12)3-7(4)10(15)16/h2-3H,1H3',
  'smiles': '[N+](=O)([O-])C1=C(C)C(=CC(=C1)[N+](=O)[O-])[N+](=O)[O-]',
  'status': 'SUCCESS',
  'stdinchi': 'InChI=1S/C7H5N3O6/c1-4-6(9(13)14)2-5(8(11)12)3-7(4)10(15)16/h2-3H,1H3',
  'stdinchikey': 'SPSSULHKWOKEEL-UHFFFAOYSA-N'
}
```
parent e4b4d773
No related branches found
No related tags found
No related merge requests found
Pipeline #13220 passed
...@@ -488,8 +488,10 @@ class TestConvertIUPACToSMILESAndMore(TestCase): ...@@ -488,8 +488,10 @@ class TestConvertIUPACToSMILESAndMore(TestCase):
] ]
for iupac, dict_expected in pairs: for iupac, dict_expected in pairs:
dict_returned = ws.convert_iupac_to_smiles_and_inchi(iupac) dict_returned = ws.convert_iupac_to_smiles_and_inchi(iupac)
self.assertEqual(dict_expected, dict_returned) self.assertEqual(dict_expected["smiles"], dict_returned["smiles"])
self.assertEqual(dict_expected["smiles"], ws.convert_iupac_to_smiles(iupac)) self.assertEqual(dict_expected["inchi"], dict_returned["inchi"])
self.assertEqual(dict_expected["stdinchi"], dict_returned["stdinchi"])
self.assertEqual(dict_expected["stdinchikey"], dict_returned["stdinchikey"])
def test_invalide_entry(self): def test_invalide_entry(self):
self.assertRaises(ws.EntryNotFoundError, ws.convert_iupac_to_smiles_and_inchi, '3-{1-oxo-6-[4-(piperid') self.assertRaises(ws.EntryNotFoundError, ws.convert_iupac_to_smiles_and_inchi, '3-{1-oxo-6-[4-(piperid')
......
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