matlab-proxy 0.14.0__py3-none-any.whl → 0.15.1__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.

Files changed (50) hide show
  1. matlab_proxy/app.py +52 -10
  2. matlab_proxy/constants.py +1 -0
  3. matlab_proxy/gui/asset-manifest.json +3 -3
  4. matlab_proxy/gui/index.html +1 -1
  5. matlab_proxy/gui/static/js/{main.14aa7840.js → main.ff1bfd69.js} +3 -3
  6. matlab_proxy/gui/static/js/main.ff1bfd69.js.map +1 -0
  7. matlab_proxy/util/__init__.py +8 -1
  8. matlab_proxy/util/mwi/download.py +145 -0
  9. matlab_proxy/util/mwi/embedded_connector/helpers.py +1 -1
  10. matlab_proxy/util/mwi/embedded_connector/request.py +1 -1
  11. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/METADATA +1 -1
  12. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/RECORD +49 -16
  13. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/top_level.txt +1 -0
  14. tests/integration/__init__.py +1 -0
  15. tests/integration/integration_tests_with_license/__init__.py +1 -0
  16. tests/integration/integration_tests_with_license/conftest.py +47 -0
  17. tests/integration/integration_tests_with_license/test_http_end_points.py +223 -0
  18. tests/integration/integration_tests_without_license/__init__.py +1 -0
  19. tests/integration/integration_tests_without_license/conftest.py +115 -0
  20. tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +49 -0
  21. tests/integration/utils/__init__.py +1 -0
  22. tests/integration/utils/integration_tests_utils.py +352 -0
  23. tests/integration/utils/licensing.py +152 -0
  24. tests/unit/__init__.py +1 -0
  25. tests/unit/conftest.py +67 -0
  26. tests/unit/test_app.py +1113 -0
  27. tests/unit/test_app_state.py +582 -0
  28. tests/unit/test_constants.py +5 -0
  29. tests/unit/test_ddux.py +22 -0
  30. tests/unit/test_devel.py +246 -0
  31. tests/unit/test_non_dev_mode.py +169 -0
  32. tests/unit/test_settings.py +460 -0
  33. tests/unit/util/__init__.py +3 -0
  34. tests/unit/util/mwi/__init__.py +1 -0
  35. tests/unit/util/mwi/embedded_connector/__init__.py +1 -0
  36. tests/unit/util/mwi/embedded_connector/test_helpers.py +29 -0
  37. tests/unit/util/mwi/embedded_connector/test_request.py +64 -0
  38. tests/unit/util/mwi/test_custom_http_headers.py +281 -0
  39. tests/unit/util/mwi/test_logger.py +49 -0
  40. tests/unit/util/mwi/test_token_auth.py +289 -0
  41. tests/unit/util/mwi/test_validators.py +331 -0
  42. tests/unit/util/test_mw.py +550 -0
  43. tests/unit/util/test_util.py +135 -0
  44. tests/utils/__init__.py +1 -0
  45. tests/utils/logging_util.py +81 -0
  46. matlab_proxy/gui/static/js/main.14aa7840.js.map +0 -1
  47. /matlab_proxy/gui/static/js/{main.14aa7840.js.LICENSE.txt → main.ff1bfd69.js.LICENSE.txt} +0 -0
  48. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/LICENSE.md +0 -0
  49. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/WHEEL +0 -0
  50. {matlab_proxy-0.14.0.dist-info → matlab_proxy-0.15.1.dist-info}/entry_points.txt +0 -0
tests/unit/conftest.py ADDED
@@ -0,0 +1,67 @@
1
+ # Copyright 2020-2022 The MathWorks, Inc.
2
+
3
+ """ The conftest.py file is run by the pytest framework for setting things up for the test session.
4
+ """
5
+
6
+ import os
7
+ import shutil
8
+ import asyncio
9
+
10
+ import pytest
11
+ from matlab_proxy import settings, util
12
+ from matlab_proxy.util.mwi import environment_variables as mwi_env
13
+
14
+
15
+ def pytest_generate_tests(metafunc):
16
+ os.environ[mwi_env.get_env_name_development()] = "true"
17
+
18
+
19
+ def __get_matlab_config_file():
20
+ return settings.get(dev=True)["matlab_config_file"]
21
+
22
+
23
+ def __delete_matlab_config_file():
24
+ os.remove(__get_matlab_config_file())
25
+
26
+
27
+ @pytest.fixture(autouse=True, scope="session")
28
+ def pre_test_cleanup():
29
+ """A pytest fixture which deletes matlab_config_file before executing tests.
30
+
31
+ If a previous pytest run fails, this file may have an empty Dict which leads
32
+ to the server never starting up matlab.
33
+ """
34
+ try:
35
+ __delete_matlab_config_file()
36
+ except FileNotFoundError:
37
+ pass
38
+
39
+
40
+ @pytest.fixture(scope="session", autouse=True)
41
+ def cleanup(request):
42
+ """Cleanup the temp directory once we are finished."""
43
+
44
+ def delete_matlab_test_dir():
45
+ # Delete matlab_config_file & its owning directory
46
+ matlab_config_file = __get_matlab_config_file()
47
+ matlab_config_dir = os.path.dirname(matlab_config_file)
48
+ try:
49
+ shutil.rmtree(matlab_config_dir)
50
+ except FileNotFoundError:
51
+ pass
52
+
53
+ request.addfinalizer(delete_matlab_test_dir)
54
+
55
+
56
+ @pytest.fixture(scope="session")
57
+ def event_loop():
58
+ """Overriding the default event loop of pytest. Intended for windows systems for
59
+ python <= 3.7 where WindowsSelectorEvent Loop is the default event loop. For
60
+ python >= 3.8, WindowsProactorEvent Loop is the default.
61
+
62
+ Yields:
63
+ asyncio.loop: WindowsProactorEvent loop in Windows or UnixSelectorEventLoop in posix.
64
+ """
65
+ loop = util.get_event_loop()
66
+ yield loop
67
+ loop.close()