Skip to content

Remove HTTP requests from test suite. #23

@At11011

Description

@At11011

In thermodynamics.rs, the reason tests were failing is because of GET requests being made to pubchem, which were occasionally being denied.

I think we should not have this functionality in the test suite. The reliance on pubchem being receptive to requests is causing tests to be unreliable, as they will only pass if pubchem does not deny our web requests everytime we test.

The end user should still be able to make these requests, but for testing, we should use a local dataset, instead of pulling them from pubchem. This is an example:

        assert_eq!(
            thermo_state.mass_list[0]
                .chemical_species
                .get_pubchem_obj()
                .cids()
                .unwrap()[0],
            962
        );

.cids() looks like this:

    /// Retrieve the Compound IDs designating the compound.
    pub fn cids(&self) -> Result<Vec<i32>, Error> {
        self.request("cids")
            .and_then(|response| rest::IdentifierList::from_api_response(response))
            .map(|list| list.cids)
    }

This reliance on a GET request is what is causing stochastic test behavior.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions