예제 #1
0
 def test_invalid_representation_request(self):
     """Test that HTTPError is raised when an invalid representation is specified."""
     with self.assertRaises(HTTPError):
         request('Morphine', 'ogiuewrgpw')
예제 #2
0
 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)
예제 #3
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)
예제 #4
0
파일: cirpy_test.py 프로젝트: leelasd/CIRpy
 def test_invalid_representation_request(self):
     """Test that HTTPError is raised when an invalid representation is specified."""
     with self.assertRaises(HTTPError):
         request('Morphine', 'ogiuewrgpw')
예제 #5
0
파일: cirpy_test.py 프로젝트: leelasd/CIRpy
 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)
예제 #6
0
파일: cirpy_test.py 프로젝트: leelasd/CIRpy
 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)