sustainable-processes / pura

Clean chemical data quickly
MIT License
10 stars 3 forks source link

Add Unit Tests for PubChem Service #48

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

This PR adds unit tests for the PubChem service in the pura library. The tests are located in a new file tests/test_services/test_pubchem.py.

The tests focus on the resolve_compound method of the PubChem class, using mocked HTTP requests to simulate interactions with the PubChem API. The tests use the pytest and unittest.mock libraries.

The test data includes name and SMILES pairs provided in the issue description. This ensures that the resolve_compound method can correctly resolve these identifiers using the PubChem service.

By adding these tests, we can increase the reliability and maintainability of the pura library, ensuring that future changes do not unintentionally break the PubChem service functionality.

Fixes #47.