matlab-proxy 0.18.0__tar.gz → 0.18.2__tar.gz
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.
- {matlab-proxy-0.18.0/matlab_proxy.egg-info → matlab-proxy-0.18.2}/PKG-INFO +1 -1
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/package-lock.json +20 -20
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/app.py +3 -1
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/settings.py +12 -2
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/environment_variables.py +1 -1
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2/matlab_proxy.egg-info}/PKG-INFO +1 -1
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/SOURCES.txt +1 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/setup.py +1 -1
- matlab-proxy-0.18.2/tests/integration/integration_tests_with_license/test_http_end_points.py +398 -0
- matlab-proxy-0.18.2/tests/unit/util/mwi/test_download.py +152 -0
- matlab-proxy-0.18.0/tests/integration/integration_tests_with_license/test_http_end_points.py +0 -223
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/LICENSE.md +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/MANIFEST.in +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/README.md +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/.eslintrc.json +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/.gitignore +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/README.md +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/package.json +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/public/favicon.ico +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/public/index.html +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/public/manifest.json +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/public/robots.txt +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/actionCreators/actionCreators.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/actionCreators/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/actions/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/css/site7.min.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/responsive/global/ico-header-account-hover.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/responsive/global/ico-header-contact-hover.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/App.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/App.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/MATLAB-env-blur.png +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/App/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Confirmation/Confirmation.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Confirmation/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/Controls.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/Controls.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/feedback.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/help.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/restart.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/sign-out.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/start.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/stop.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Controls/terminate.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/EntitlementSelector/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Error/Error.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Error/Error.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Error/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Help/Help.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Help/Help.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Help/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Information/Information.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Information/Information.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Information/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/ExistingLicense.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/MHLM.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/NLM.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/LicensingGatherer/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/MatlabJsd/MatlabJsd.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/MatlabJsd/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Overlay/Overlay.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Overlay/Overlay.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/Overlay/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/constants.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/index.css +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/jest.config.json +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/logo.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/reducers/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/reducers/reducers.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/selectors/index.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/selectors/selectors.spec.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/serviceWorker.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/setupTests.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/test/utils/react-test.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/gui/src/test/utils/state.js +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/app_state.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/constants.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/default_configuration.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/devel.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/icons/matlab.svg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/matlab/evaluateUserMatlabCode.m +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/matlab/startup.m +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/event_loop.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/list_servers.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mw.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/download.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/exceptions.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/logger.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/token_auth.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/mwi/validators.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/system.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy/util/windows.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/dependency_links.txt +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/entry_points.txt +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/not-zip-safe +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/requires.txt +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/matlab_proxy.egg-info/top_level.txt +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/setup.cfg +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/integration_tests_with_license/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/integration_tests_with_license/conftest.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/integration_tests_without_license/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/integration_tests_without_license/conftest.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/utils/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/utils/integration_tests_utils.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/integration/utils/licensing.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/conftest.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_app.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_app_state.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_constants.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_ddux.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_devel.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_non_dev_mode.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/test_settings.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/embedded_connector/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/embedded_connector/test_helpers.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/embedded_connector/test_request.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/test_custom_http_headers.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/test_logger.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/test_token_auth.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/mwi/test_validators.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/test_mw.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/unit/util/test_util.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/utils/__init__.py +0 -0
- {matlab-proxy-0.18.0 → matlab-proxy-0.18.2}/tests/utils/logging_util.py +0 -0
|
@@ -5600,11 +5600,11 @@
|
|
|
5600
5600
|
}
|
|
5601
5601
|
},
|
|
5602
5602
|
"node_modules/braces": {
|
|
5603
|
-
"version": "3.0.
|
|
5604
|
-
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.
|
|
5605
|
-
"integrity": "sha512-
|
|
5603
|
+
"version": "3.0.3",
|
|
5604
|
+
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
|
5605
|
+
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
|
5606
5606
|
"dependencies": {
|
|
5607
|
-
"fill-range": "^7.
|
|
5607
|
+
"fill-range": "^7.1.1"
|
|
5608
5608
|
},
|
|
5609
5609
|
"engines": {
|
|
5610
5610
|
"node": ">=8"
|
|
@@ -7060,9 +7060,9 @@
|
|
|
7060
7060
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
|
7061
7061
|
},
|
|
7062
7062
|
"node_modules/ejs": {
|
|
7063
|
-
"version": "3.1.
|
|
7064
|
-
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.
|
|
7065
|
-
"integrity": "sha512-
|
|
7063
|
+
"version": "3.1.10",
|
|
7064
|
+
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
|
7065
|
+
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
|
7066
7066
|
"dependencies": {
|
|
7067
7067
|
"jake": "^10.8.5"
|
|
7068
7068
|
},
|
|
@@ -8664,9 +8664,9 @@
|
|
|
8664
8664
|
}
|
|
8665
8665
|
},
|
|
8666
8666
|
"node_modules/fill-range": {
|
|
8667
|
-
"version": "7.
|
|
8668
|
-
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.
|
|
8669
|
-
"integrity": "sha512-
|
|
8667
|
+
"version": "7.1.1",
|
|
8668
|
+
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
|
8669
|
+
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
|
8670
8670
|
"dependencies": {
|
|
8671
8671
|
"to-regex-range": "^5.0.1"
|
|
8672
8672
|
},
|
|
@@ -22839,11 +22839,11 @@
|
|
|
22839
22839
|
}
|
|
22840
22840
|
},
|
|
22841
22841
|
"braces": {
|
|
22842
|
-
"version": "3.0.
|
|
22843
|
-
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.
|
|
22844
|
-
"integrity": "sha512-
|
|
22842
|
+
"version": "3.0.3",
|
|
22843
|
+
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
|
22844
|
+
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
|
22845
22845
|
"requires": {
|
|
22846
|
-
"fill-range": "^7.
|
|
22846
|
+
"fill-range": "^7.1.1"
|
|
22847
22847
|
}
|
|
22848
22848
|
},
|
|
22849
22849
|
"browser-process-hrtime": {
|
|
@@ -23891,9 +23891,9 @@
|
|
|
23891
23891
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
|
|
23892
23892
|
},
|
|
23893
23893
|
"ejs": {
|
|
23894
|
-
"version": "3.1.
|
|
23895
|
-
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.
|
|
23896
|
-
"integrity": "sha512-
|
|
23894
|
+
"version": "3.1.10",
|
|
23895
|
+
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
|
23896
|
+
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
|
23897
23897
|
"requires": {
|
|
23898
23898
|
"jake": "^10.8.5"
|
|
23899
23899
|
}
|
|
@@ -25023,9 +25023,9 @@
|
|
|
25023
25023
|
"integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ=="
|
|
25024
25024
|
},
|
|
25025
25025
|
"fill-range": {
|
|
25026
|
-
"version": "7.
|
|
25027
|
-
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.
|
|
25028
|
-
"integrity": "sha512-
|
|
25026
|
+
"version": "7.1.1",
|
|
25027
|
+
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
|
25028
|
+
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
|
25029
25029
|
"requires": {
|
|
25030
25030
|
"to-regex-range": "^5.0.1"
|
|
25031
25031
|
}
|
|
@@ -624,10 +624,12 @@ async def matlab_view(req):
|
|
|
624
624
|
|
|
625
625
|
# Standard HTTP Request
|
|
626
626
|
else:
|
|
627
|
-
# Proxy, injecting request header
|
|
627
|
+
# Proxy, injecting request header, disabling request timeouts
|
|
628
|
+
timeout = aiohttp.ClientTimeout(total=None)
|
|
628
629
|
async with aiohttp.ClientSession(
|
|
629
630
|
trust_env=True,
|
|
630
631
|
connector=aiohttp.TCPConnector(verify_ssl=False),
|
|
632
|
+
timeout=timeout,
|
|
631
633
|
) as client_session:
|
|
632
634
|
try:
|
|
633
635
|
req_body = await transform_body(req)
|
|
@@ -395,8 +395,10 @@ def get_matlab_settings():
|
|
|
395
395
|
has_custom_code_to_execute = (
|
|
396
396
|
len(os.getenv(mwi_env.get_env_name_custom_matlab_code(), "").strip()) > 0
|
|
397
397
|
)
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
|
|
399
|
+
# Sanitize file paths to avoid MATLAB not running the script due to early breakup of character array.
|
|
400
|
+
mp_code_to_execute = f"try; run('{_sanitize_file_path_for_matlab(matlab_startup_file)}'); catch MATLABProxyInitializationError; disp(MATLABProxyInitializationError.message); end;"
|
|
401
|
+
custom_code_to_execute = f"try; run('{_sanitize_file_path_for_matlab(matlab_code_file)}'); catch MATLABCustomStartupCodeError; disp(MATLABCustomStartupCodeError.message); end;"
|
|
400
402
|
code_to_execute = (
|
|
401
403
|
mp_code_to_execute + custom_code_to_execute
|
|
402
404
|
if has_custom_code_to_execute
|
|
@@ -621,3 +623,11 @@ def generate_new_self_signed_certs(mwi_certs_dir):
|
|
|
621
623
|
cert_file = priv_key_file = None
|
|
622
624
|
|
|
623
625
|
return cert_file, priv_key_file
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
def _sanitize_file_path_for_matlab(filepath: str) -> str:
|
|
629
|
+
"""
|
|
630
|
+
Replace single quotes in the filepath with double single quotes to preserve the quote when used in MATLAB code.
|
|
631
|
+
"""
|
|
632
|
+
filepath_with_single_quotes_escaped = filepath.replace("'", "''")
|
|
633
|
+
return filepath_with_single_quotes_escaped
|
|
@@ -187,7 +187,7 @@ class Experimental:
|
|
|
187
187
|
@staticmethod
|
|
188
188
|
def should_use_mos_html():
|
|
189
189
|
"""Returns true if matlab-proxy should use MOS htmls to load MATLAB"""
|
|
190
|
-
return _is_env_set_to_true("MWI_USE_MOS")
|
|
190
|
+
return _is_env_set_to_true("MWI_USE_MOS")
|
|
191
191
|
|
|
192
192
|
@staticmethod
|
|
193
193
|
def should_use_mre_html():
|
|
@@ -156,6 +156,7 @@ tests/unit/util/test_mw.py
|
|
|
156
156
|
tests/unit/util/test_util.py
|
|
157
157
|
tests/unit/util/mwi/__init__.py
|
|
158
158
|
tests/unit/util/mwi/test_custom_http_headers.py
|
|
159
|
+
tests/unit/util/mwi/test_download.py
|
|
159
160
|
tests/unit/util/mwi/test_logger.py
|
|
160
161
|
tests/unit/util/mwi/test_token_auth.py
|
|
161
162
|
tests/unit/util/mwi/test_validators.py
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
# Copyright 2023-2024 The MathWorks, Inc.
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Contains integration tests which exercise HTTP endpoints of interest exposed by matlab-proxy-app
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Imports
|
|
8
|
+
from enum import Enum
|
|
9
|
+
import json
|
|
10
|
+
import os
|
|
11
|
+
import pytest
|
|
12
|
+
import re
|
|
13
|
+
import requests
|
|
14
|
+
import time
|
|
15
|
+
from requests.adapters import HTTPAdapter, Retry
|
|
16
|
+
from urllib.parse import urlparse, parse_qs
|
|
17
|
+
|
|
18
|
+
# Local module imports
|
|
19
|
+
import matlab_proxy.settings as settings
|
|
20
|
+
from matlab_proxy.constants import MWI_AUTH_TOKEN_NAME_FOR_HTTP
|
|
21
|
+
from matlab_proxy.util import system
|
|
22
|
+
from tests.integration.utils import integration_tests_utils as utils
|
|
23
|
+
from tests.utils.logging_util import create_integ_test_logger
|
|
24
|
+
|
|
25
|
+
# Logger Setup
|
|
26
|
+
_logger = create_integ_test_logger(__name__)
|
|
27
|
+
|
|
28
|
+
# Constants
|
|
29
|
+
|
|
30
|
+
# Timeout for polling the matlab-proxy http endpoints
|
|
31
|
+
# matlab proxy in Mac machines takes more time to be 'up'
|
|
32
|
+
MAX_TIMEOUT = settings.get_process_startup_timeout()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Format(Enum):
|
|
36
|
+
"""
|
|
37
|
+
An enumeration to specify different format types.
|
|
38
|
+
|
|
39
|
+
Attributes:
|
|
40
|
+
JSON (int): Represents the JSON format type.
|
|
41
|
+
TEXT (int): Represents the plain text format type.
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
JSON = 1
|
|
45
|
+
TEXT = 2
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Utility Functions
|
|
49
|
+
def _http_get_request(
|
|
50
|
+
uri, connection_scheme, headers, http_endpoint="", outputFormat=Format.TEXT
|
|
51
|
+
):
|
|
52
|
+
"""
|
|
53
|
+
Sends an HTTP GET request to a specified URI, optionally appending an endpoint to the URI.
|
|
54
|
+
|
|
55
|
+
This function uses a session with retries configured for transient network errors. It can return
|
|
56
|
+
the response in either text or JSON format, based on the outputFormat parameter.
|
|
57
|
+
|
|
58
|
+
Parameters:
|
|
59
|
+
- uri (str): The base URI for the HTTP request.
|
|
60
|
+
- connection_scheme (str): The scheme to use for the connection (e.g., 'http' or 'https').
|
|
61
|
+
- headers (dict): A dictionary of HTTP headers to include in the request.
|
|
62
|
+
- http_endpoint (str, optional): An additional endpoint to append to the base URI. Defaults to an empty string.
|
|
63
|
+
- outputFormat (format, optional): The desired format for the response content. This should be an attribute
|
|
64
|
+
of a format enumeration, supporting at least 'TEXT' and 'JSON' options. Defaults to Format.TEXT.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
- str or dict: The response content as a string if outputFormat is Format.TEXT, or as a dictionary
|
|
68
|
+
if outputFormat is Format.JSON.
|
|
69
|
+
|
|
70
|
+
Raises:
|
|
71
|
+
- Exception: If an invalid output format is specified.
|
|
72
|
+
|
|
73
|
+
Note:
|
|
74
|
+
- The function disables SSL certificate verification (`verify=False`). This may introduce security risks,
|
|
75
|
+
such as vulnerability to man-in-the-middle attacks. Use with caution in a production environment.
|
|
76
|
+
"""
|
|
77
|
+
request_uri = uri + http_endpoint
|
|
78
|
+
with requests.Session() as s:
|
|
79
|
+
retries = Retry(total=10, backoff_factor=0.1)
|
|
80
|
+
s.mount(f"{connection_scheme}://", HTTPAdapter(max_retries=retries))
|
|
81
|
+
response = s.get(request_uri, headers=headers, verify=False)
|
|
82
|
+
|
|
83
|
+
if outputFormat == Format.TEXT:
|
|
84
|
+
return response.text
|
|
85
|
+
elif outputFormat == Format.JSON:
|
|
86
|
+
return json.loads(response.text)
|
|
87
|
+
|
|
88
|
+
raise Exception("Invalid output format specified.")
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _check_matlab_status(matlab_proxy_app_fixture, status):
|
|
92
|
+
"""
|
|
93
|
+
Check the status of a MATLAB session until a specified status is reached or a timeout occurs.
|
|
94
|
+
|
|
95
|
+
This function repeatedly sends HTTP GET requests to a MATLAB proxy application to check the current
|
|
96
|
+
status of MATLAB. It continues checking until MATLAB's status matches the specified target status or
|
|
97
|
+
until a maximum timeout is reached.
|
|
98
|
+
|
|
99
|
+
Parameters:
|
|
100
|
+
- matlab_proxy_app_fixture: An object containing configuration for connecting to the MATLAB proxy application.
|
|
101
|
+
This object must have the following attributes:
|
|
102
|
+
- url (str): The base URL of the MATLAB proxy application.
|
|
103
|
+
- connection_scheme (str): The scheme used for the connection (e.g., 'http' or 'https').
|
|
104
|
+
- headers (dict): A dictionary of HTTP headers to be sent with each request.
|
|
105
|
+
- status (str): The target status to wait for MATLAB to reach.
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
- str: The status of MATLAB at the end of the function execution. This could be the target status if
|
|
109
|
+
it was reached within the timeout period, or the last known status of MATLAB if the timeout was reached
|
|
110
|
+
first.
|
|
111
|
+
|
|
112
|
+
Notes:
|
|
113
|
+
- The function waits for a maximum of MAX_TIMEOUT seconds, defined elsewhere, before exiting.
|
|
114
|
+
- It checks the MATLAB status every 1 second.
|
|
115
|
+
- The MATLAB status is obtained by sending a GET request to the '/get_status' endpoint of the proxy application.
|
|
116
|
+
- The response from the proxy application is expected to be in JSON format, with MATLAB's status accessible
|
|
117
|
+
via `res["matlab"]["status"]`.
|
|
118
|
+
|
|
119
|
+
Exceptions:
|
|
120
|
+
- This function may raise exceptions related to network issues or JSON parsing errors, which are not
|
|
121
|
+
explicitly handled within the function.
|
|
122
|
+
"""
|
|
123
|
+
uri = matlab_proxy_app_fixture.url
|
|
124
|
+
connection_scheme = matlab_proxy_app_fixture.connection_scheme
|
|
125
|
+
headers = matlab_proxy_app_fixture.headers
|
|
126
|
+
|
|
127
|
+
matlab_status = None
|
|
128
|
+
|
|
129
|
+
start_time = time.time()
|
|
130
|
+
while matlab_status != status and (time.time() - start_time < MAX_TIMEOUT):
|
|
131
|
+
time.sleep(1)
|
|
132
|
+
res = _http_get_request(
|
|
133
|
+
uri,
|
|
134
|
+
connection_scheme,
|
|
135
|
+
headers,
|
|
136
|
+
http_endpoint="/get_status",
|
|
137
|
+
outputFormat=Format.JSON,
|
|
138
|
+
)
|
|
139
|
+
matlab_status = res["matlab"]["status"]
|
|
140
|
+
|
|
141
|
+
return matlab_status
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _download_test_file(matlab_proxy_app_fixture, test_file):
|
|
145
|
+
"""Returns result of hitting the /download endpoint for test_file.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
str: The contents of the test_file being downloaded through matlab-proxy.
|
|
149
|
+
"""
|
|
150
|
+
uri = matlab_proxy_app_fixture.url
|
|
151
|
+
connection_scheme = matlab_proxy_app_fixture.connection_scheme
|
|
152
|
+
headers = matlab_proxy_app_fixture.headers
|
|
153
|
+
|
|
154
|
+
res = _http_get_request(
|
|
155
|
+
uri,
|
|
156
|
+
connection_scheme,
|
|
157
|
+
headers,
|
|
158
|
+
http_endpoint="/download/" + test_file,
|
|
159
|
+
outputFormat=Format.TEXT,
|
|
160
|
+
)
|
|
161
|
+
return res
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
# Main Classes
|
|
165
|
+
class RealMATLABServer:
|
|
166
|
+
"""
|
|
167
|
+
Context Manager class which returns matlab proxy web server serving real MATLAB
|
|
168
|
+
for testing.
|
|
169
|
+
|
|
170
|
+
Setting up the server in the context of Pytest.
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
def __init__(self, event_loop):
|
|
174
|
+
self.event_loop = event_loop
|
|
175
|
+
|
|
176
|
+
def __enter__(self):
|
|
177
|
+
# Store the matlab proxy logs in os.pipe for testing
|
|
178
|
+
# os.pipe2 is only supported in Linux systems
|
|
179
|
+
_logger.info("Setting up MATLAB Server for integration test")
|
|
180
|
+
|
|
181
|
+
_logger.debug("Entering RealMATLABServer enter section.")
|
|
182
|
+
self.dpipe = os.pipe2(os.O_NONBLOCK) if system.is_linux() else os.pipe()
|
|
183
|
+
self.mwi_app_port = utils.get_random_free_port()
|
|
184
|
+
self.matlab_config_file_path = str(utils.get_matlab_config_file())
|
|
185
|
+
|
|
186
|
+
self.temp_dir_path = os.path.dirname(
|
|
187
|
+
os.path.dirname(self.matlab_config_file_path)
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
self.temp_dir_name = "temp_dir"
|
|
191
|
+
self.mwi_base_url = "/matlab-test"
|
|
192
|
+
|
|
193
|
+
# Environment variables to launch matlab proxy
|
|
194
|
+
input_env = {
|
|
195
|
+
"MWI_APP_PORT": self.mwi_app_port,
|
|
196
|
+
"MWI_BASE_URL": self.mwi_base_url,
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
self.proc = self.event_loop.run_until_complete(
|
|
200
|
+
utils.start_matlab_proxy_app(out=self.dpipe[1], input_env=input_env)
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
utils.wait_server_info_ready(self.mwi_app_port)
|
|
204
|
+
parsed_url = urlparse(utils.get_connection_string(self.mwi_app_port))
|
|
205
|
+
|
|
206
|
+
self.headers = {
|
|
207
|
+
MWI_AUTH_TOKEN_NAME_FOR_HTTP: (
|
|
208
|
+
parse_qs(parsed_url.query)[MWI_AUTH_TOKEN_NAME_FOR_HTTP][0]
|
|
209
|
+
if MWI_AUTH_TOKEN_NAME_FOR_HTTP in parse_qs(parsed_url.query)
|
|
210
|
+
else ""
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
self.connection_scheme = parsed_url.scheme
|
|
214
|
+
self.url = parsed_url.scheme + "://" + parsed_url.netloc + parsed_url.path
|
|
215
|
+
return self
|
|
216
|
+
|
|
217
|
+
async def _terminate_process(self, timeout=0):
|
|
218
|
+
"""
|
|
219
|
+
Asynchronous helper method to terminate the process with a timeout.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
timeout: Maximum number of seconds to wait
|
|
223
|
+
for the process to terminate
|
|
224
|
+
|
|
225
|
+
"""
|
|
226
|
+
import asyncio
|
|
227
|
+
|
|
228
|
+
process = self.proc
|
|
229
|
+
try:
|
|
230
|
+
process.terminate()
|
|
231
|
+
await asyncio.wait_for(process.wait(), timeout=timeout)
|
|
232
|
+
except asyncio.TimeoutError:
|
|
233
|
+
_logger.warning(
|
|
234
|
+
"Termination of the MATLAB Server process timed out. Attempting to kill."
|
|
235
|
+
)
|
|
236
|
+
process.kill()
|
|
237
|
+
await process.wait()
|
|
238
|
+
_logger.debug("Killed the MATLAB process after timeout.")
|
|
239
|
+
|
|
240
|
+
def __exit__(self, exc_type, exc_value, exc_traceback):
|
|
241
|
+
_logger.info("Tearing down the MATLAB Server.")
|
|
242
|
+
self.event_loop.run_until_complete(self._terminate_process(timeout=10))
|
|
243
|
+
_logger.debug("Terminated the MATLAB process.")
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
# Fixtures
|
|
247
|
+
@pytest.fixture
|
|
248
|
+
def matlab_proxy_app_fixture(
|
|
249
|
+
loop,
|
|
250
|
+
):
|
|
251
|
+
"""A pytest fixture which yields a real matlab server to be used by tests.
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
loop (Event event_loop): The built-in event event_loop provided by pytest.
|
|
255
|
+
|
|
256
|
+
Yields:
|
|
257
|
+
real_matlab_server : A real matlab web server used by tests.
|
|
258
|
+
"""
|
|
259
|
+
|
|
260
|
+
try:
|
|
261
|
+
with RealMATLABServer(loop) as matlab_proxy_app:
|
|
262
|
+
yield matlab_proxy_app
|
|
263
|
+
except ProcessLookupError as e:
|
|
264
|
+
_logger.debug("ProcessLookupError found in matlab proxy app fixture")
|
|
265
|
+
_logger.debug(e)
|
|
266
|
+
pass
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
@pytest.fixture
|
|
270
|
+
def test_file_contents():
|
|
271
|
+
"""
|
|
272
|
+
A pytest fixture that provides a string for testing purposes.
|
|
273
|
+
|
|
274
|
+
This fixture returns a predefined string that can be used in tests to simulate
|
|
275
|
+
the contents of a file or any scenario where a constant string value is needed.
|
|
276
|
+
|
|
277
|
+
Returns:
|
|
278
|
+
str: A string containing the text "I LOVE MATLAB."
|
|
279
|
+
"""
|
|
280
|
+
return "I LOVE MATLAB."
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
@pytest.fixture
|
|
284
|
+
def test_file(tmp_path, test_file_contents):
|
|
285
|
+
"""
|
|
286
|
+
A pytest fixture that creates a temporary test file with given contents.
|
|
287
|
+
|
|
288
|
+
This fixture utilizes pytest's `tmp_path` fixture to generate a temporary directory,
|
|
289
|
+
then creates a file named "temporary_test_file.txt" within this directory,
|
|
290
|
+
and writes the provided contents to this file. It is useful for tests that require
|
|
291
|
+
reading from or writing to files without affecting the actual file system.
|
|
292
|
+
|
|
293
|
+
Parameters:
|
|
294
|
+
- tmp_path (Path): A pytest fixture that provides a temporary directory unique to the test function.
|
|
295
|
+
- test_file_contents (str): The content to be written into the temporary test file.
|
|
296
|
+
|
|
297
|
+
Returns:
|
|
298
|
+
- str: The path to the created temporary test file as a string.
|
|
299
|
+
"""
|
|
300
|
+
test_file = os.path.join(tmp_path, "temporary_test_file.txt")
|
|
301
|
+
with open(test_file, "w+") as f:
|
|
302
|
+
f.write(test_file_contents)
|
|
303
|
+
return test_file
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
# Test Functions
|
|
307
|
+
def test_matlab_is_up(matlab_proxy_app_fixture):
|
|
308
|
+
"""Test that the status switches from 'starting' to 'up' within a timeout.
|
|
309
|
+
|
|
310
|
+
Args:
|
|
311
|
+
matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
|
|
312
|
+
"""
|
|
313
|
+
|
|
314
|
+
status = _check_matlab_status(matlab_proxy_app_fixture, "up")
|
|
315
|
+
assert status == "up"
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
def test_stop_matlab(matlab_proxy_app_fixture):
|
|
319
|
+
"""Test to check that matlab is in 'down' state when
|
|
320
|
+
we send the delete request to 'stop_matlab' endpoint
|
|
321
|
+
|
|
322
|
+
Args:
|
|
323
|
+
matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
|
|
324
|
+
"""
|
|
325
|
+
status = _check_matlab_status(matlab_proxy_app_fixture, "up")
|
|
326
|
+
assert status == "up"
|
|
327
|
+
|
|
328
|
+
http_endpoint_to_test = "/stop_matlab"
|
|
329
|
+
stop_url = matlab_proxy_app_fixture.url + http_endpoint_to_test
|
|
330
|
+
|
|
331
|
+
with requests.Session() as s:
|
|
332
|
+
retries = Retry(total=10, backoff_factor=0.1)
|
|
333
|
+
s.mount(
|
|
334
|
+
f"{matlab_proxy_app_fixture.connection_scheme}://",
|
|
335
|
+
HTTPAdapter(max_retries=retries),
|
|
336
|
+
)
|
|
337
|
+
s.delete(stop_url, headers=matlab_proxy_app_fixture.headers, verify=False)
|
|
338
|
+
|
|
339
|
+
status = _check_matlab_status(matlab_proxy_app_fixture, "down")
|
|
340
|
+
assert status == "down"
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
async def test_print_message(matlab_proxy_app_fixture):
|
|
344
|
+
"""Test if the right logs are printed
|
|
345
|
+
|
|
346
|
+
Args:
|
|
347
|
+
matlab_proxy_app_fixture: A pytest fixture which yields a real matlab server to be used by tests.
|
|
348
|
+
|
|
349
|
+
FIXME: If output has logging or extra debug info, 600 bytes might not be enough.
|
|
350
|
+
"""
|
|
351
|
+
# Checks if matlab proxy is in "up" state or not
|
|
352
|
+
status = _check_matlab_status(matlab_proxy_app_fixture, "up")
|
|
353
|
+
assert status == "up"
|
|
354
|
+
|
|
355
|
+
uri_regex = f"{matlab_proxy_app_fixture.connection_scheme}://[a-zA-Z0-9\-_.]+:{matlab_proxy_app_fixture.mwi_app_port}{matlab_proxy_app_fixture.mwi_base_url}"
|
|
356
|
+
|
|
357
|
+
read_descriptor, write_descriptor = matlab_proxy_app_fixture.dpipe
|
|
358
|
+
number_of_bytes = 600
|
|
359
|
+
|
|
360
|
+
if read_descriptor:
|
|
361
|
+
line = os.read(read_descriptor, number_of_bytes).decode("utf-8")
|
|
362
|
+
process_logs = line.strip()
|
|
363
|
+
|
|
364
|
+
assert bool(re.search(uri_regex, process_logs)) == True
|
|
365
|
+
|
|
366
|
+
# Close the read and write descriptors.
|
|
367
|
+
os.close(read_descriptor)
|
|
368
|
+
os.close(write_descriptor)
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
def test_download_file_from_matlab(
|
|
372
|
+
matlab_proxy_app_fixture, test_file, test_file_contents
|
|
373
|
+
):
|
|
374
|
+
"""
|
|
375
|
+
Test the downloading of a file from a MATLAB proxy application.
|
|
376
|
+
|
|
377
|
+
This test function checks if the MATLAB proxy application is up and running, and then attempts to download
|
|
378
|
+
a specific test file from it. It validates both the status of the MATLAB proxy and the contents of the downloaded file.
|
|
379
|
+
|
|
380
|
+
Parameters:
|
|
381
|
+
- matlab_proxy_app_fixture (fixture): A test fixture representing the MATLAB proxy application environment.
|
|
382
|
+
- test_file (str): The name or path of the test file to be downloaded from the MATLAB proxy application.
|
|
383
|
+
- test_file_contents (str): The expected contents of the test file to validate the download operation.
|
|
384
|
+
|
|
385
|
+
Assertions:
|
|
386
|
+
- Asserts that the MATLAB proxy application is "up".
|
|
387
|
+
- Asserts that the content of the downloaded file matches the expected `test_file_contents`.
|
|
388
|
+
|
|
389
|
+
Raises:
|
|
390
|
+
- AssertionError: If any of the assertions fail, indicating either the MATLAB proxy application is not running
|
|
391
|
+
as expected or there is a mismatch in the file content.
|
|
392
|
+
"""
|
|
393
|
+
status = _check_matlab_status(matlab_proxy_app_fixture, "up")
|
|
394
|
+
assert status == "up"
|
|
395
|
+
|
|
396
|
+
# Once MATLAB is up, we can then attempt to download
|
|
397
|
+
result = _download_test_file(matlab_proxy_app_fixture, test_file)
|
|
398
|
+
assert result == test_file_contents
|