matlab-proxy 0.16.0__py3-none-any.whl → 0.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of matlab-proxy might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -1,14 +1,14 @@
1
1
  matlab_proxy/__init__.py,sha256=6cwi8buKCMtw9OeWaOYUHEoqwl5MyJ_s6GxgNuqPuNg,1673
2
- matlab_proxy/app.py,sha256=-QcfNOCyXAQu58Gq-bSU4iHtJrVglxgD0c-n6nTzumo,33819
3
- matlab_proxy/app_state.py,sha256=tHZpv2pEk_zb55FKDvnIIcIg-S3i-r52h5WHot-wITI,55450
2
+ matlab_proxy/app.py,sha256=aoKkhw_E71uCJeMzqr9VE4mrIRd_4Aqt3Uw4nrYiZZY,34386
3
+ matlab_proxy/app_state.py,sha256=-8gduqMymI7U_NwNRtL26skrjOlnDRiM2vXqBTfMnKo,59525
4
4
  matlab_proxy/constants.py,sha256=gHL6bYgRDyzufMx1XF9tbtC9vsS_yQlfYPNommti8tA,972
5
5
  matlab_proxy/default_configuration.py,sha256=DxQaHzAivzstiPl_nDfxs8SOyP9oaK9v3RP4LtroJl4,843
6
6
  matlab_proxy/devel.py,sha256=nR6XPVBUEdQ-RZGtYvX1YHTp8gj9cuw5Hp8ahasMBc8,14310
7
7
  matlab_proxy/settings.py,sha256=Q901JN7zwcySVOs7EQ69m4Ngishmo9ihFzqbPxXajh4,24915
8
8
  matlab_proxy/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- matlab_proxy/gui/asset-manifest.json,sha256=Y0bASwFy_ZO21iJjvOmN9Rf4pgvKRqpVMxVQ5g0eU2Q,3516
9
+ matlab_proxy/gui/asset-manifest.json,sha256=XqmLvi3DDOGSbBxNZwjuaNJXoYjZiG2HasxvZnEzPEo,3516
10
10
  matlab_proxy/gui/favicon.ico,sha256=7w7Ki1uQP2Rgwc64dOV4-NrTu97I3WsZw8OvRSoY1A0,130876
11
- matlab_proxy/gui/index.html,sha256=R6bC4lxj_0V0mmXr4Rqf9mHQoDWkNY0CpKBGNvxWaWs,637
11
+ matlab_proxy/gui/index.html,sha256=lWKKMXjAyOc-vk6t4rasj49sa2UgXAAlMdWYCd5V8N8,637
12
12
  matlab_proxy/gui/manifest.json,sha256=NwDbrALM5auYyj2bbEf4aGwAUDqNl1FzMFQpPiG2Ty4,286
13
13
  matlab_proxy/gui/robots.txt,sha256=kNJLw79pisHhc3OVAimMzKcq3x9WT6sF9IS4xI0crdI,67
14
14
  matlab_proxy/gui/static/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -16,9 +16,9 @@ matlab_proxy/gui/static/css/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
16
16
  matlab_proxy/gui/static/css/main.47712126.css,sha256=OT5ccyC0a6fVg956C-8b6uDVbZZVgcpXbHjdO6v4ZBI,274313
17
17
  matlab_proxy/gui/static/css/main.47712126.css.map,sha256=RdfmXfQvzvvh4XZuDWShm8CD8pA2Gb2K6MtMzrgJyKM,350495
18
18
  matlab_proxy/gui/static/js/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- matlab_proxy/gui/static/js/main.522d83ba.js,sha256=6Mr6KC2dNysr7aA1VUObaA-2XZDPeZbA7FWl3W3GH68,294192
20
- matlab_proxy/gui/static/js/main.522d83ba.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
- matlab_proxy/gui/static/js/main.522d83ba.js.map,sha256=dJifP1EbrR0Dli2vzs_uRFhJ10MG_6Zwaw2GtWWEkq0,937322
19
+ matlab_proxy/gui/static/js/main.5b5ca2f2.js,sha256=XvoCZpW63pLcHvS9meZxIId_yQPC3w5SuGIij5VwOEc,294436
20
+ matlab_proxy/gui/static/js/main.5b5ca2f2.js.LICENSE.txt,sha256=3cj3DrwM51esz1ogL9VVU1ZyXyXJ6u-Ec2CI9CCcI_A,1689
21
+ matlab_proxy/gui/static/js/main.5b5ca2f2.js.map,sha256=mCDweY7BuQ4Ld5c6Z521rjPGrIlIzG2b_DjxsW_eo6M,938339
22
22
  matlab_proxy/gui/static/media/MATLAB-env-blur.4fc94edbc82d3184e5cb.png,sha256=QpmQTLDvBu2-b7ev83Rvpt0Q72R6wdQGkuJMPPpjv7M,220290
23
23
  matlab_proxy/gui/static/media/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  matlab_proxy/gui/static/media/arrow.0c2968b90bd9a64c8c3f.svg,sha256=XtmvDWzGZnwCZm08TKBnqt5hc1wphJnNupG0Fx_faAY,327
@@ -82,8 +82,8 @@ tests/integration/utils/integration_tests_utils.py,sha256=IbJ9CedFHiz3k85FBY-8Gw
82
82
  tests/integration/utils/licensing.py,sha256=rEBjvMXO8R3mL6KnePu2lojmOsjD4GXl9frf9N0Wacs,4842
83
83
  tests/unit/__init__.py,sha256=KfwQxxM5a1kMRtNbhz8tb7YfHp8e2d0tNLB55wYvDS8,37
84
84
  tests/unit/conftest.py,sha256=Hfxq3h8IZuLJkRMh5jdEFiq78CIAdKvm-6KryRDZ0FY,1918
85
- tests/unit/test_app.py,sha256=8hR0pWEIWrXU2UTZLLug9spaadp5Hb33960RE3jy4mw,37300
86
- tests/unit/test_app_state.py,sha256=wuEAYCXT262Ew01tRVP_SwRDa_M6MlzkkKuGTlcbGaY,18790
85
+ tests/unit/test_app.py,sha256=xiiEQu1iNK0h3Yuwn3c-hgvNhC1EXKFgTbE_7U3mSrs,37731
86
+ tests/unit/test_app_state.py,sha256=xwXOmyzamL89eg4q2s4IpFKWDN4r2lZwsHBafqDkins,21854
87
87
  tests/unit/test_constants.py,sha256=ieDKc7bL8zWsd_D4dv2n8iftXr2h-bkS5p6zVan0BtQ,125
88
88
  tests/unit/test_ddux.py,sha256=a2J2iM8j_nnfJVuMI38p5AjwrRdoMj3N88gFgS2I4hg,713
89
89
  tests/unit/test_devel.py,sha256=A-1iVhSSwmywaW65QIRcUS2Fk7nJxceCcCm7CJtNdEc,7982
@@ -102,9 +102,9 @@ tests/unit/util/mwi/embedded_connector/test_helpers.py,sha256=vYTWNUTuDeaygo16JG
102
102
  tests/unit/util/mwi/embedded_connector/test_request.py,sha256=PR-jddnXDEiip-lD7A_QSvRwEkwo3eQ8owZlk-r9vnk,1867
103
103
  tests/utils/__init__.py,sha256=ttzJ8xKWGxOJZz56qOiWOn6sp5LGomkZMn_w4KJLRMU,42
104
104
  tests/utils/logging_util.py,sha256=VBy_NRvwau3C_CVTBjK5RMROrQimnJYHO2U0aKSZiRw,2234
105
- matlab_proxy-0.16.0.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
106
- matlab_proxy-0.16.0.dist-info/METADATA,sha256=OhfB2b3xNfmm_1jHPjgpc2wOXa_te8IO4xxjmLNi0Q4,10108
107
- matlab_proxy-0.16.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
108
- matlab_proxy-0.16.0.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
109
- matlab_proxy-0.16.0.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
110
- matlab_proxy-0.16.0.dist-info/RECORD,,
105
+ matlab_proxy-0.17.0.dist-info/LICENSE.md,sha256=oF0h3UdSF-rlUiMGYwi086ZHqelzz7yOOk9HFDv9ELo,2344
106
+ matlab_proxy-0.17.0.dist-info/METADATA,sha256=_UnbcVVZElb72b3PjnP85kmOmqYdzoXv1tcsEGkVD5s,10108
107
+ matlab_proxy-0.17.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
108
+ matlab_proxy-0.17.0.dist-info/entry_points.txt,sha256=DbBLYgnRt8UGiOpd0zHigRTyyMdZYhMdvCvSYP7wPN0,244
109
+ matlab_proxy-0.17.0.dist-info/top_level.txt,sha256=9uVTjsUCAS4TwsxueTBxrBg3PdBiTSsYowAkHPv9VY0,19
110
+ matlab_proxy-0.17.0.dist-info/RECORD,,
tests/unit/test_app.py CHANGED
@@ -284,6 +284,20 @@ async def test_get_status_route(test_server):
284
284
  assert resp.status == HTTPStatus.OK
285
285
 
286
286
 
287
+ async def test_clear_client_id_route(test_server):
288
+ """Test to check endpoint: "/clear_client_id"
289
+
290
+ Args:
291
+ test_server (aiohttp_client): A aiohttp_client server for sending POST request.
292
+ """
293
+
294
+ state = test_server.server.app["state"]
295
+ state.active_client = "mock_client_id"
296
+ resp = await test_server.post("/clear_client_id")
297
+ assert resp.status == HTTPStatus.OK
298
+ assert state.active_client is None
299
+
300
+
287
301
  async def test_get_env_config(test_server):
288
302
  """Test to check endpoint : "/get_env_config"
289
303
 
@@ -584,3 +584,81 @@ async def test_start_matlab_without_xvfb(app_state_fixture, mocker):
584
584
  assert app_state_fixture.processes["xvfb"] is None
585
585
  # Check if Matlab started
586
586
  assert app_state_fixture.processes["matlab"] is mock_matlab
587
+
588
+
589
+ @pytest.mark.parametrize(
590
+ "is_desktop, client_id, is_client_id_present, expected_is_active_client",
591
+ [
592
+ (False, None, False, None),
593
+ (False, "mock_id", False, None),
594
+ (True, None, True, True),
595
+ (True, "mock_id", False, True),
596
+ ],
597
+ ids=[
598
+ "request_from_non-desktop_client",
599
+ "request_from_non-desktop_client_having_mock_id",
600
+ "request_from_desktop_client",
601
+ "request_from_desktop_client_having_mock_id",
602
+ ],
603
+ )
604
+ async def test_get_session_status(
605
+ app_state_fixture,
606
+ is_desktop,
607
+ client_id,
608
+ is_client_id_present,
609
+ expected_is_active_client,
610
+ ):
611
+ """Test to check if correnct session response is returned based on various conditions.
612
+
613
+ Args:
614
+ app_state_fixture (AppState): Object of AppState class with defaults set
615
+ is_desktop (bool): A flag indicating whether the client is a desktop client.
616
+ client_id (str or None): The client ID. If None, a new client ID may be generated.
617
+ is_client_id_present (bool): Indicates whether the expected value of client_id is string or not.
618
+ expected_is_active_client (bool): Indicates the expected value of is_active_client
619
+
620
+ """
621
+ # The value of transfer_session is a Don't Care condition as initially the value of client_id is always None.
622
+ output_client_id, output_is_active_client = app_state_fixture.get_session_status(
623
+ is_desktop, client_id, transfer_session=False
624
+ )
625
+ assert isinstance(output_client_id, str) == is_client_id_present, (
626
+ "Expected client_id to be a string got None"
627
+ if is_client_id_present
628
+ else "Expected client_id to be None got a string value"
629
+ )
630
+ assert (
631
+ output_is_active_client == expected_is_active_client
632
+ ), f"Expected is_active_client to be {expected_is_active_client} got {output_is_active_client}"
633
+ # For clean up of task_detect_client_status
634
+ app_state_fixture.active_client = None
635
+
636
+
637
+ async def test_get_session_status_can_transfer_session(app_state_fixture):
638
+ """Test to check whether transer session changes client id to the new id
639
+
640
+ Args:
641
+ app_state_fixture (AppState): Object of AppState class with defaults set
642
+ """
643
+ app_state_fixture.active_client = "mock_id"
644
+ app_state_fixture.get_session_status(
645
+ is_desktop=True, client_id="new_id", transfer_session=True
646
+ )
647
+ assert app_state_fixture.active_client == "new_id"
648
+ # For clean up of task_detect_client_status
649
+ app_state_fixture.active_client = None
650
+
651
+
652
+ async def test_detect_active_client_status_can_reset_active_client(app_state_fixture):
653
+ """Test to check whether the value of active client is being reset due to the client inactivity.
654
+
655
+ Args:
656
+ app_state_fixture (AppState): Object of AppState class with defaults set
657
+ """
658
+ app_state_fixture.active_client = "mock_id"
659
+ await app_state_fixture.detect_active_client_status(
660
+ sleep_time=0, max_inactive_count=0
661
+ )
662
+ assert (
663
+ app_state_fixture.active_client == None
664
+ ), f"Expected the active_client to be None"