def test_invalid_representation_request(self): """Test that HTTPError is raised when an invalid representation is specified.""" with self.assertRaises(HTTPError): request('Morphine', 'ogiuewrgpw')
def test_no_result_request(self): """Test that an empty XML response is returned when there are no results.""" response = request('arguergbaiurg', 'smiles') self.assertEqual(response.tag, 'request') self.assertEqual(len(response), 0)
def test_requests(self): """Test a variety of basic requests to ensure they return the expected XML response.""" self.assertEqual(request('c1ccccc1', 'names').tag, 'request') self.assertEqual(request('Aspirin', 'smiles').tag, 'request') self.assertEqual(len(request('64-17-5', 'stdinchi')), 1)