@@ -447,7 +447,7 @@ async def test_matlab_proxy_web_socket(test_server):
447447 assert text .type == aiohttp .WSMsgType .CLOSED
448448
449449
450- async def test_set_licensing_info_put (test_server ):
450+ async def test_set_licensing_info_put_nlm (test_server ):
451451 """Test to check endpoint : "/set_licensing_info"
452452
453453 Test which sends HTTP PUT request with NLM licensing information.
@@ -465,6 +465,44 @@ async def test_set_licensing_info_put(test_server):
465465 assert resp .status == 200
466466
467467
468+ async def test_set_licensing_info_put_invalid_license (test_server ):
469+ """Test to check endpoint : "/set_licensing_info"
470+
471+ Test which sends HTTP PUT request with INVALID licensing information type.
472+ Args:
473+ test_server (aiohttp_client): A aiohttp_client server to send HTTP GET request.
474+ """
475+
476+ data = {
477+ "type" : "INVALID_TYPE" ,
478+ "status" : "starting" ,
479+ "version" : "R2020b" ,
480+ "connectionString" : "abc@nlm" ,
481+ }
482+ resp = await test_server .put ("/set_licensing_info" , data = json .dumps (data ))
483+ assert resp .status == 400
484+
485+
486+ async def test_set_licensing_info_put_mhlm (test_server ):
487+ """Test to check endpoint : "/set_licensing_info"
488+
489+ Test which sends HTTP PUT request with MHLM licensing information.
490+ Args:
491+ test_server (aiohttp_client): A aiohttp_client server to send HTTP GET request.
492+ """
493+
494+ data = {
495+ "type" : "MHLM" ,
496+ "status" : "starting" ,
497+ "version" : "R2020b" ,
498+ "token" : "abc@nlm" ,
499+ "emailaddress" : "abc@nlm" ,
500+ "sourceId" : "abc@nlm" ,
501+ }
502+ resp = await test_server .put ("/set_licensing_info" , data = json .dumps (data ))
503+ assert resp .status == 200
504+
505+
468506async def test_set_licensing_info_delete (test_server ):
469507 """Test to check endpoint : "/set_licensing_info"
470508
@@ -477,3 +515,17 @@ async def test_set_licensing_info_delete(test_server):
477515 resp = await test_server .delete ("/set_licensing_info" )
478516 resp_json = json .loads (await resp .text ())
479517 assert resp .status == 200 and resp_json ["licensing" ] is None
518+
519+
520+ async def test_set_termination_integration_delete (test_server ):
521+ """Test to check endpoint : "/terminate_integration"
522+
523+ Test which sends HTTP DELETE request to terminate integration. Checks if integration is terminated
524+ successfully.
525+ Args:
526+ test_server (aiohttp_client): A aiohttp_client server to send HTTP GET request.
527+ """
528+
529+ resp = await test_server .delete ("/terminate_integration" )
530+ resp_json = json .loads (await resp .text ())
531+ assert resp .status == 200 and resp_json ["loadUrl" ] == "../"
0 commit comments