Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-10 08:39:00

0001 # Description: Unit tests for the IDDS API methods
0002 # TODO: These tests are placeholders and need to be completed
0003 import unittest
0004 
0005 from pandaserver.api.v1.http_client import HttpClient, api_url_ssl
0006 
0007 
0008 class TestIDDSAPI(unittest.TestCase):
0009     def setUp(self):
0010         self.http_client = HttpClient()
0011 
0012     def test_relay_idds_command(self):
0013         url = f"{api_url_ssl}/idds/relay_idds_command"
0014         print(f"Testing URL: {url}")
0015         data = {}
0016         status, output = self.http_client.get(url, data)
0017         print(output)
0018         output["status"] = status
0019 
0020         # Remove the data field from the response for comparison
0021         del output["data"]
0022 
0023         expected_response = {"success": True, "message": "", "status": 0}
0024 
0025         self.assertEqual(output, expected_response)
0026 
0027     def test_execute_idds_workflow_command(self):
0028         url = f"{api_url_ssl}/statistics/execute_idds_workflow_command"
0029         print(f"Testing URL: {url}")
0030         data = {}
0031         status, output = self.http_client.get(url, data)
0032         print(output)
0033         output["status"] = status
0034 
0035         # Remove the data field from the response for comparison
0036         del output["data"]
0037 
0038         expected_response = {"success": True, "message": "", "status": 0}
0039 
0040         self.assertEqual(output, expected_response)
0041 
0042 
0043 # Run tests
0044 if __name__ == "__main__":
0045     unittest.main()