コード例 #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)