matlab-proxy 0.13.1__py3-none-any.whl → 0.15.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.
- matlab_proxy/app.py +66 -5
- matlab_proxy/constants.py +1 -0
- matlab_proxy/gui/asset-manifest.json +3 -3
- matlab_proxy/gui/index.html +1 -1
- matlab_proxy/gui/static/js/{main.0fcee5e5.js → main.14aa7840.js} +3 -3
- matlab_proxy/gui/static/js/main.14aa7840.js.map +1 -0
- matlab_proxy/util/mw.py +4 -4
- matlab_proxy/util/mwi/download.py +145 -0
- matlab_proxy/util/mwi/embedded_connector/helpers.py +1 -1
- matlab_proxy/util/mwi/embedded_connector/request.py +3 -3
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/METADATA +2 -1
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/RECORD +29 -16
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/WHEEL +1 -1
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/top_level.txt +1 -0
- tests/integration/__init__.py +1 -0
- tests/integration/integration_tests_with_license/__init__.py +1 -0
- tests/integration/integration_tests_with_license/conftest.py +47 -0
- tests/integration/integration_tests_with_license/test_http_end_points.py +223 -0
- tests/integration/integration_tests_without_license/__init__.py +1 -0
- tests/integration/integration_tests_without_license/conftest.py +115 -0
- tests/integration/integration_tests_without_license/test_matlab_is_down_if_unlicensed.py +46 -0
- tests/integration/utils/__init__.py +1 -0
- tests/integration/utils/integration_tests_utils.py +352 -0
- tests/integration/utils/licensing.py +152 -0
- tests/utils/__init__.py +1 -0
- tests/utils/logging_util.py +81 -0
- matlab_proxy/gui/static/js/main.0fcee5e5.js.map +0 -1
- /matlab_proxy/gui/static/js/{main.0fcee5e5.js.LICENSE.txt → main.14aa7840.js.LICENSE.txt} +0 -0
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/LICENSE.md +0 -0
- {matlab_proxy-0.13.1.dist-info → matlab_proxy-0.15.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Copyright 2024 The MathWorks, Inc.
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from os import getenv
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def create_integ_test_logger(
|
|
9
|
+
log_name,
|
|
10
|
+
log_level=getenv("MWI_TEST_LOG_LEVEL", "WARNING"),
|
|
11
|
+
log_file_path=getenv("MWI_INTEG_TESTS_LOG_FILE_PATH"),
|
|
12
|
+
):
|
|
13
|
+
return create_test_logger(
|
|
14
|
+
log_name, log_level, log_file_path, output_prefix="INTEG TEST"
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def create_unit_test_logger(
|
|
19
|
+
log_name,
|
|
20
|
+
log_level=getenv("MWI_TEST_LOG_LEVEL", "WARNING"),
|
|
21
|
+
log_file_path=getenv("MWI_UNIT_TESTS_LOG_FILE_PATH"),
|
|
22
|
+
):
|
|
23
|
+
return create_test_logger(
|
|
24
|
+
log_name, log_level, log_file_path, output_prefix="UNIT TEST"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def create_test_logger(
|
|
29
|
+
log_name,
|
|
30
|
+
log_level=getenv("MWI_TEST_LOG_LEVEL", "WARNING"),
|
|
31
|
+
log_file_path=None,
|
|
32
|
+
output_prefix="TEST",
|
|
33
|
+
):
|
|
34
|
+
"""
|
|
35
|
+
Returns a logger with specified name and level
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
log_file_path (string): Log file path to which the logs should be written
|
|
39
|
+
log_level (logger level attribute): Log level to be set for the logger
|
|
40
|
+
log_name (string): Name of the logger to be used
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
# Create a logger with the name 'TEST'
|
|
44
|
+
logger = logging.getLogger(output_prefix + " - " + log_name)
|
|
45
|
+
|
|
46
|
+
# Create a formatter
|
|
47
|
+
formatter = logging.Formatter(
|
|
48
|
+
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
# Set the logging level (e.g., DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
52
|
+
logger.setLevel(log_level)
|
|
53
|
+
|
|
54
|
+
if log_file_path:
|
|
55
|
+
file_path = Path(log_file_path)
|
|
56
|
+
|
|
57
|
+
# Create a file handler
|
|
58
|
+
file_handler = logging.FileHandler(filename=file_path, mode="a")
|
|
59
|
+
|
|
60
|
+
# Set a logging level for the file
|
|
61
|
+
file_handler.setLevel(log_level)
|
|
62
|
+
|
|
63
|
+
# Set the formatter for the console handler
|
|
64
|
+
file_handler.setFormatter(formatter)
|
|
65
|
+
|
|
66
|
+
# Add the console handler to the logger
|
|
67
|
+
logger.addHandler(file_handler)
|
|
68
|
+
|
|
69
|
+
# Create a console handler
|
|
70
|
+
console_handler = logging.StreamHandler()
|
|
71
|
+
|
|
72
|
+
# Set a logging level for the console handler
|
|
73
|
+
console_handler.setLevel(log_level)
|
|
74
|
+
|
|
75
|
+
# Set the formatter for the console handler
|
|
76
|
+
console_handler.setFormatter(formatter)
|
|
77
|
+
|
|
78
|
+
# Add the console handler to the logger
|
|
79
|
+
logger.addHandler(console_handler)
|
|
80
|
+
|
|
81
|
+
return logger
|