aplos-nca-saas-sdk 0.0.12__tar.gz → 0.0.13__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.
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/.gitignore +3 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/LICENSE +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/PKG-INFO +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/pyproject.toml +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +7 -2
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings_config.py +29 -29
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +9 -9
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/file_upload_config.py +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/login_config.py +15 -14
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_execution_config.py +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +2 -2
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +9 -5
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +10 -3
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/main.py +8 -7
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/readme.md +1 -1
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +3 -3
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +3 -3
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +107 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_test.py +2 -2
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/tests/validation_test.py +1 -1
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/_api_base.py +44 -0
- {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources}/aws_cognito.py +2 -2
- {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources}/aws_s3_presigned_payload.py +3 -3
- {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources}/aws_s3_presigned_upload.py +28 -22
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/nca_resources/nca_analysis.py +23 -167
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +4 -4
- aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_login.py → aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/nca_authenticator.py +23 -20
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +84 -0
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/nca_file_download.py +130 -0
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +55 -0
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/nca_resources/nca_validations.py +34 -0
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/run_analysis_execution.py +148 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +29 -13
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/utilities/environment_services.py +3 -2
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +10 -4
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/utilities/file_utility.py +1 -1
- aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/utilities/http_utility.py +21 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/version.py +1 -1
- aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +0 -158
- aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -58
- aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +0 -57
- aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -46
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/.pypirc +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/.vscode/launch.json +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/.vscode/settings.json +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/README.md +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/devops/pypi/build.py +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/devops/pypi/readme.md +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/devops/requirements.txt +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/docs/images/API_Configuration_blur.png +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/docs/images/aplos-nca-commandline-cropped.png +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/docs/images/aplos-nca-commandline.png +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/mypy.ini +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/mypy_checks.py +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/readme.md +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/requirements.txt +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/run-checks.sh +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/__init__.py +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/executions/config1.json +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.csv +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.dat +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.sas7bdat +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xls +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xlsx +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xpt +0 -0
- /aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/configuration_single_ev.json → /aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/config.json +0 -0
- /aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/files/analysis_files/single_ev/single_ev.csv → /aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/input.csv +0 -0
- {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/files → aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/sample_files}/analysis_files/single_ev/meta_data.json +0 -0
- {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.13}/tests/__init__.py +0 -0
@@ -1,5 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
"""
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
|
+
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
|
+
Property of Aplos Analytics, Utah, USA
|
5
|
+
"""
|
6
|
+
|
7
|
+
from typing import Dict, Any
|
3
8
|
|
4
9
|
|
5
10
|
class ConfigBase:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -8,26 +8,26 @@ from typing import List, Dict, Any
|
|
8
8
|
from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
|
9
9
|
|
10
10
|
|
11
|
-
class
|
11
|
+
class ApplicationHostConfig(ConfigBase):
|
12
12
|
"""
|
13
|
-
Application
|
13
|
+
Application host: Defines the domains that the application configuration tests will check against
|
14
14
|
|
15
15
|
"""
|
16
16
|
|
17
|
-
def __init__(self,
|
17
|
+
def __init__(self, host: str | None = None):
|
18
18
|
super().__init__()
|
19
|
-
self.
|
19
|
+
self.__host: str | None = host
|
20
20
|
|
21
21
|
@property
|
22
|
-
def
|
23
|
-
"""The
|
24
|
-
if self.
|
25
|
-
raise RuntimeError("
|
26
|
-
return self.
|
22
|
+
def host(self) -> str:
|
23
|
+
"""The host to validate"""
|
24
|
+
if self.__host is None:
|
25
|
+
raise RuntimeError("host is not set")
|
26
|
+
return self.__host
|
27
27
|
|
28
|
-
@
|
29
|
-
def
|
30
|
-
self.
|
28
|
+
@host.setter
|
29
|
+
def host(self, value: str):
|
30
|
+
self.__host = value
|
31
31
|
|
32
32
|
|
33
33
|
class ApplicationDomainConfigs(ConfigBase):
|
@@ -38,19 +38,19 @@ class ApplicationDomainConfigs(ConfigBase):
|
|
38
38
|
|
39
39
|
def __init__(self):
|
40
40
|
super().__init__()
|
41
|
-
self.
|
41
|
+
self.__hosts: List[ApplicationHostConfig] = []
|
42
42
|
|
43
43
|
@property
|
44
|
-
def list(self) -> List[
|
44
|
+
def list(self) -> List[ApplicationHostConfig]:
|
45
45
|
"""List the logins"""
|
46
|
-
return self.
|
46
|
+
return self.__hosts
|
47
47
|
|
48
|
-
def add(self, *,
|
48
|
+
def add(self, *, host: str, enabled: bool = True):
|
49
49
|
"""Add a loging"""
|
50
|
-
app_domain =
|
51
|
-
app_domain.
|
50
|
+
app_domain = ApplicationHostConfig()
|
51
|
+
app_domain.host = host
|
52
52
|
app_domain.enabled = enabled
|
53
|
-
self.
|
53
|
+
self.__hosts.append(app_domain)
|
54
54
|
|
55
55
|
def load(self, test_config: Dict[str, Any]):
|
56
56
|
"""Load the logins from a list of dictionaries"""
|
@@ -58,13 +58,13 @@ class ApplicationDomainConfigs(ConfigBase):
|
|
58
58
|
super().load(test_config)
|
59
59
|
domains: List[Dict[str, Any]] = test_config.get("domains", [])
|
60
60
|
|
61
|
-
|
62
|
-
for
|
63
|
-
app_domain =
|
64
|
-
app_domain.
|
65
|
-
app_domain.enabled = bool(
|
61
|
+
host: Dict[str, Any]
|
62
|
+
for host in domains:
|
63
|
+
app_domain = ApplicationHostConfig()
|
64
|
+
app_domain.host = host.get("host", None)
|
65
|
+
app_domain.enabled = bool(host.get("enabled", True))
|
66
66
|
|
67
|
-
self.
|
67
|
+
self.__hosts.append(app_domain)
|
68
68
|
|
69
69
|
|
70
70
|
class ApplicationSettings(ConfigBase):
|
@@ -75,12 +75,12 @@ class ApplicationSettings(ConfigBase):
|
|
75
75
|
|
76
76
|
def __init__(self):
|
77
77
|
super().__init__()
|
78
|
-
self.
|
78
|
+
self.__hosts: ApplicationDomainConfigs = ApplicationDomainConfigs()
|
79
79
|
|
80
80
|
@property
|
81
81
|
def domains(self) -> ApplicationDomainConfigs:
|
82
|
-
"""List of the
|
83
|
-
return self.
|
82
|
+
"""List of the host"""
|
83
|
+
return self.__hosts
|
84
84
|
|
85
85
|
def load(self, test_config: Dict[str, Any]):
|
86
86
|
"""Load the domains from the config"""
|
@@ -3,14 +3,14 @@
|
|
3
3
|
"purpose": "Tests the application configuration endpoints",
|
4
4
|
"domains": [
|
5
5
|
{
|
6
|
-
"
|
6
|
+
"host": "api.example.com",
|
7
7
|
"expected_results": {
|
8
8
|
"status_code": 200
|
9
9
|
},
|
10
10
|
"enabled": true
|
11
11
|
},
|
12
12
|
{
|
13
|
-
"
|
13
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX",
|
14
14
|
"expected_results": {
|
15
15
|
"status_code": 403
|
16
16
|
},
|
@@ -24,13 +24,13 @@
|
|
24
24
|
{
|
25
25
|
"username": "foo",
|
26
26
|
"password": "barr",
|
27
|
-
"
|
27
|
+
"host": "api.example.com",
|
28
28
|
"roles": []
|
29
29
|
},
|
30
30
|
{
|
31
31
|
"username": "XXXXXXXXXXXXXXXXXXXXX",
|
32
32
|
"password": "XXXXXXXXXXXXXXXXXXXXX",
|
33
|
-
"
|
33
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX",
|
34
34
|
"roles": [
|
35
35
|
"XXXXXXXXXXXXXXXXXXXXX"
|
36
36
|
],
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"purpose": "optional: if present this login is used, unless a specific login is defined for the test",
|
49
49
|
"username": "foo",
|
50
50
|
"password": "bar",
|
51
|
-
"
|
51
|
+
"host": "api.example.com"
|
52
52
|
},
|
53
53
|
"files": [
|
54
54
|
{
|
@@ -60,7 +60,7 @@
|
|
60
60
|
"purpose": "optional: if present tests an upload for a specific user",
|
61
61
|
"username": "XXXXXXXXXXXXXXXXXXXXX",
|
62
62
|
"password": "XXXXXXXXXXXXXXXXXXXXX",
|
63
|
-
"
|
63
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX"
|
64
64
|
}
|
65
65
|
}
|
66
66
|
]
|
@@ -70,7 +70,7 @@
|
|
70
70
|
"login": {
|
71
71
|
"username": "XXXXXXXXXXXXXXXXXXXXX",
|
72
72
|
"password": "XXXXXXXXXXXXXXXXXXXXX",
|
73
|
-
"
|
73
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX"
|
74
74
|
},
|
75
75
|
"output_dir": "XXXXXXXXXXXXXXXXXXXXX",
|
76
76
|
"analyses": [
|
@@ -90,7 +90,7 @@
|
|
90
90
|
"login": {
|
91
91
|
"username": "XXXXXXXXXXXXXXXXXXXXX",
|
92
92
|
"password": "XXXXXXXXXXXXXXXXXXXXX",
|
93
|
-
"
|
93
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX"
|
94
94
|
},
|
95
95
|
"expected_results": {
|
96
96
|
"status_code": 200
|
@@ -103,7 +103,7 @@
|
|
103
103
|
"login": {
|
104
104
|
"username": "XXXXXXXXXXXXXXXXXXXXX",
|
105
105
|
"password": "XXXXXXXXXXXXXXXXXXXXX",
|
106
|
-
"
|
106
|
+
"host": "XXXXXXXXXXXXXXXXXXXXX"
|
107
107
|
},
|
108
108
|
"expected_results": {
|
109
109
|
"status_code": 200
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -18,13 +18,13 @@ class LoginConfig(ConfigBase):
|
|
18
18
|
self,
|
19
19
|
username: Optional[str] = None,
|
20
20
|
passord: Optional[str] = None,
|
21
|
-
|
21
|
+
host: Optional[str] = None,
|
22
22
|
roles: Optional[List[str]] = None,
|
23
23
|
):
|
24
24
|
super().__init__()
|
25
25
|
self.__username: Optional[str] = username
|
26
26
|
self.__password: Optional[str] = passord
|
27
|
-
self.
|
27
|
+
self.__host: Optional[str] = host
|
28
28
|
self.__roles: List[str] = roles if roles is not None else []
|
29
29
|
|
30
30
|
@property
|
@@ -48,14 +48,15 @@ class LoginConfig(ConfigBase):
|
|
48
48
|
self.__password = value
|
49
49
|
|
50
50
|
@property
|
51
|
-
def
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
def host(self) -> str:
|
52
|
+
"""API Host"""
|
53
|
+
if self.__host is None:
|
54
|
+
raise RuntimeError("Host is not set")
|
55
|
+
return self.__host
|
55
56
|
|
56
|
-
@
|
57
|
-
def
|
58
|
-
self.
|
57
|
+
@host.setter
|
58
|
+
def host(self, value: str):
|
59
|
+
self.__host = value
|
59
60
|
|
60
61
|
@property
|
61
62
|
def roles(self) -> List[str]:
|
@@ -84,12 +85,12 @@ class LoginConfigs(ConfigBase):
|
|
84
85
|
"""List the logins"""
|
85
86
|
return self.__logins
|
86
87
|
|
87
|
-
def add(self, *, username: str, password: str,
|
88
|
+
def add(self, *, username: str, password: str, host: str, enabled: bool = True):
|
88
89
|
"""Add a loging"""
|
89
90
|
login = LoginConfig()
|
90
91
|
login.username = username
|
91
92
|
login.password = password
|
92
|
-
login.
|
93
|
+
login.host = host
|
93
94
|
login.enabled = enabled
|
94
95
|
self.__logins.append(login)
|
95
96
|
|
@@ -111,8 +112,8 @@ class LoginConfigs(ConfigBase):
|
|
111
112
|
if login_config is not None:
|
112
113
|
username = login_config.get("username", None)
|
113
114
|
password = login_config.get("password", None)
|
114
|
-
|
115
|
+
host = login_config.get("host", None)
|
115
116
|
enabled = login_config.get("enabled", True)
|
116
|
-
login = LoginConfig(username, password,
|
117
|
+
login = LoginConfig(username, password, host)
|
117
118
|
login.enabled = enabled
|
118
119
|
return login
|
@@ -1,11 +1,11 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
6
6
|
|
7
|
-
from typing import Dict, Any, List
|
8
7
|
from abc import ABC, abstractmethod
|
8
|
+
from typing import List
|
9
9
|
|
10
10
|
from aplos_nca_saas_sdk.integration_testing.integration_test_configurations import (
|
11
11
|
TestConfiguration,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -9,9 +9,13 @@ from typing import Any, Dict
|
|
9
9
|
from aplos_nca_saas_sdk.integration_testing.configs.app_settings_config import (
|
10
10
|
ApplicationSettings,
|
11
11
|
)
|
12
|
-
from aplos_nca_saas_sdk.integration_testing.configs.file_upload_config import
|
12
|
+
from aplos_nca_saas_sdk.integration_testing.configs.file_upload_config import (
|
13
|
+
FileUploadConfigs,
|
14
|
+
)
|
13
15
|
from aplos_nca_saas_sdk.integration_testing.configs.login_config import LoginConfigs
|
14
|
-
from aplos_nca_saas_sdk.integration_testing.configs.nca_execution_config import
|
16
|
+
from aplos_nca_saas_sdk.integration_testing.configs.nca_execution_config import (
|
17
|
+
NCAExecutionConfigs,
|
18
|
+
)
|
15
19
|
|
16
20
|
|
17
21
|
class TestConfiguration:
|
@@ -25,7 +29,7 @@ class TestConfiguration:
|
|
25
29
|
self.logins: LoginConfigs = LoginConfigs()
|
26
30
|
self.file_uploads: FileUploadConfigs = FileUploadConfigs()
|
27
31
|
self.nca_executions: NCAExecutionConfigs = NCAExecutionConfigs()
|
28
|
-
|
32
|
+
|
29
33
|
def load(self, file_path: str):
|
30
34
|
"""
|
31
35
|
Loads the configuration from a file
|
@@ -41,4 +45,4 @@ class TestConfiguration:
|
|
41
45
|
self.logins.load(config.get("login_test", {}))
|
42
46
|
self.app_config.load(config.get("application_config_test", {}))
|
43
47
|
self.file_uploads.load(config.get("file_upload_test", {}))
|
44
|
-
self.nca_executions.load(config.get("analysis_execution_test", {}))
|
48
|
+
self.nca_executions.load(config.get("analysis_execution_test", {}))
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -93,6 +93,8 @@ class IntegrationTestSuite:
|
|
93
93
|
return len(failures) == 0
|
94
94
|
|
95
95
|
def __print_results(self, start_time: datetime, failures: List[Dict[str, Any]]):
|
96
|
+
print("")
|
97
|
+
print("--------------------------------")
|
96
98
|
print("Test Results:")
|
97
99
|
skipped = sum([test["skipped_count"] for test in self.test_results])
|
98
100
|
|
@@ -101,8 +103,6 @@ class IntegrationTestSuite:
|
|
101
103
|
print(
|
102
104
|
f" {test_result['test_name']} {'succeeded' if test_result['success'] else 'failed'} duration: {duration}"
|
103
105
|
)
|
104
|
-
if not test_result["success"]:
|
105
|
-
print(f" Errors: {test_result['errors']}")
|
106
106
|
|
107
107
|
print(f"Test Suite completed in {datetime.now(UTC) - start_time}")
|
108
108
|
|
@@ -110,3 +110,10 @@ class IntegrationTestSuite:
|
|
110
110
|
print(f" Successful: {len(self.test_results) - len(failures) - skipped}")
|
111
111
|
print(f" Skipped: {skipped}")
|
112
112
|
print(f" Failed: {len(failures)}")
|
113
|
+
|
114
|
+
if len(failures) > 0:
|
115
|
+
print("--------------------------------")
|
116
|
+
|
117
|
+
for test_result in self.test_results:
|
118
|
+
if not test_result["success"]:
|
119
|
+
print(f"Errors: {test_result['errors']}")
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -36,28 +36,29 @@ def main():
|
|
36
36
|
)
|
37
37
|
# load it so we can see what it looks like
|
38
38
|
config.load(file_path=config_file)
|
39
|
-
|
39
|
+
|
40
40
|
# override the configuration
|
41
41
|
# override_config(config)
|
42
42
|
|
43
43
|
its.test(test_config=config)
|
44
44
|
|
45
|
+
|
45
46
|
def override_config(config: TestConfiguration):
|
46
47
|
"""Override the configuration for the tests"""
|
47
48
|
username = os.getenv("TEST_USERNAME")
|
48
49
|
password = os.getenv("TEST_PASSWORD")
|
49
|
-
|
50
|
+
host = os.getenv("TEST_HOST")
|
50
51
|
|
51
|
-
if not username or not password or not
|
52
|
+
if not username or not password or not host:
|
52
53
|
raise RuntimeError(
|
53
|
-
"TEST_USERNAME, TEST_PASSWORD, and
|
54
|
+
"TEST_USERNAME, TEST_PASSWORD, and TEST_HOST must be set in the environment"
|
54
55
|
)
|
55
56
|
|
56
57
|
config.logins.list.clear()
|
57
|
-
config.logins.add(username=username, password=password,
|
58
|
+
config.logins.add(username=username, password=password, host=host)
|
58
59
|
|
59
60
|
config.app_config.domains.list.clear()
|
60
|
-
config.app_config.domains.add(
|
61
|
+
config.app_config.domains.add(host=host)
|
61
62
|
|
62
63
|
|
63
64
|
if __name__ == "__main__":
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -27,10 +27,10 @@ class TestAppConfiguration(IntegrationTestBase):
|
|
27
27
|
|
28
28
|
self.results.clear()
|
29
29
|
for domain_config in self.config.app_config.domains.list:
|
30
|
-
config: NCAAppConfiguration = NCAAppConfiguration(domain_config.
|
30
|
+
config: NCAAppConfiguration = NCAAppConfiguration(domain_config.host)
|
31
31
|
|
32
32
|
test_response: IntegrationTestResponse = IntegrationTestResponse()
|
33
|
-
test_response.meta = {"
|
33
|
+
test_response.meta = {"host": domain_config}
|
34
34
|
|
35
35
|
if not domain_config.enabled or not self.config.app_config.enabled:
|
36
36
|
test_response.skipped = True
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
6
6
|
|
7
|
-
from aplos_nca_saas_sdk.nca_resources.
|
7
|
+
from aplos_nca_saas_sdk.nca_resources.nca_authenticator import NCAAuthenticator
|
8
8
|
|
9
9
|
|
10
10
|
from aplos_nca_saas_sdk.integration_testing.integration_test_base import (
|
@@ -35,7 +35,7 @@ class TestAppLogin(IntegrationTestBase):
|
|
35
35
|
self.results.append(test_response)
|
36
36
|
continue
|
37
37
|
try:
|
38
|
-
nca_login =
|
38
|
+
nca_login = NCAAuthenticator(host=login.host)
|
39
39
|
token = nca_login.authenticate(
|
40
40
|
username=login.username, password=login.password
|
41
41
|
)
|
aplos_nca_saas_sdk-0.0.13/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
"""
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
|
+
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
|
+
Property of Aplos Analytics, Utah, USA
|
5
|
+
"""
|
6
|
+
|
7
|
+
import time
|
8
|
+
from datetime import datetime, timedelta
|
9
|
+
from typing import Any, Dict, List
|
10
|
+
|
11
|
+
import requests
|
12
|
+
from aws_lambda_powertools import Logger
|
13
|
+
from aplos_nca_saas_sdk.integration_testing.configs.login_config import LoginConfig
|
14
|
+
from aplos_nca_saas_sdk.integration_testing.integration_test_base import (
|
15
|
+
IntegrationTestBase,
|
16
|
+
)
|
17
|
+
from aplos_nca_saas_sdk.integration_testing.integration_test_response import (
|
18
|
+
IntegrationTestResponse,
|
19
|
+
)
|
20
|
+
from aplos_nca_saas_sdk.nca_resources.nca_file_upload import NCAFileUpload
|
21
|
+
from aplos_nca_saas_sdk.nca_resources.nca_file_download import NCAFileDownload
|
22
|
+
from aplos_nca_saas_sdk.nca_resources.nca_authenticator import NCAAuthenticator
|
23
|
+
from aplos_nca_saas_sdk.utilities.http_utility import HttpUtilities
|
24
|
+
from aplos_nca_saas_sdk.integration_testing.configs.file_upload_config import (
|
25
|
+
FileUploadConfig,
|
26
|
+
)
|
27
|
+
|
28
|
+
logger = Logger()
|
29
|
+
|
30
|
+
|
31
|
+
class FileUploadTest(IntegrationTestBase):
|
32
|
+
"""File Upload Test Container"""
|
33
|
+
|
34
|
+
def __init__(self):
|
35
|
+
super().__init__("file-upload")
|
36
|
+
|
37
|
+
def test(self) -> bool:
|
38
|
+
"""Test file upload"""
|
39
|
+
|
40
|
+
self.results.clear()
|
41
|
+
|
42
|
+
file_upload: FileUploadConfig
|
43
|
+
for file_upload in self.config.file_uploads.list:
|
44
|
+
test_response: IntegrationTestResponse = IntegrationTestResponse()
|
45
|
+
test_response.name = self.name
|
46
|
+
try:
|
47
|
+
# Confirm Login
|
48
|
+
nca_login = self.__login(file_upload.login)
|
49
|
+
# if not nca_login.cognito.jwt:
|
50
|
+
# test_response.error = "Failed to authenticate"
|
51
|
+
# else:
|
52
|
+
# Confirm Upload
|
53
|
+
upload_response: Dict[str, Any] = self.__upload(
|
54
|
+
nca_login, file_upload.file_path
|
55
|
+
)
|
56
|
+
if upload_response is None:
|
57
|
+
test_response.error = "Failed to upload"
|
58
|
+
else:
|
59
|
+
# Confirm conversion and download
|
60
|
+
# Allow time buffer so file data is available
|
61
|
+
file_id: str = upload_response.get("file_id", "")
|
62
|
+
if not file_id:
|
63
|
+
raise RuntimeError("Failed to get a file_id from the upload")
|
64
|
+
time.sleep(3)
|
65
|
+
self.__download(nca_login, file_id, test_response)
|
66
|
+
|
67
|
+
except Exception as e: # pylint: disable=w0718
|
68
|
+
test_response.error = str(e)
|
69
|
+
|
70
|
+
self.results.append(test_response)
|
71
|
+
|
72
|
+
return self.success()
|
73
|
+
|
74
|
+
def __login(self, login: LoginConfig) -> NCAAuthenticator:
|
75
|
+
nca_login = NCAAuthenticator(host=login.host)
|
76
|
+
nca_login.authenticate(username=login.username, password=login.password)
|
77
|
+
return nca_login
|
78
|
+
|
79
|
+
def __upload(self, auth: NCAAuthenticator, upload_file_path: str) -> Dict[str, Any]:
|
80
|
+
logger.info({"message": "Uploading file", "file_path": upload_file_path})
|
81
|
+
|
82
|
+
nca_file_upload = NCAFileUpload(auth.host)
|
83
|
+
nca_file_upload.authenticator = auth
|
84
|
+
upload_response: Dict[str, Any] = nca_file_upload.upload(upload_file_path)
|
85
|
+
return upload_response
|
86
|
+
|
87
|
+
def __download(
|
88
|
+
self,
|
89
|
+
nca_login: NCAAuthenticator,
|
90
|
+
file_id: str,
|
91
|
+
test_response: IntegrationTestResponse,
|
92
|
+
):
|
93
|
+
logger.info({"message": "Downloading file", "file_id": file_id})
|
94
|
+
downloader: NCAFileDownload = NCAFileDownload(nca_login.host)
|
95
|
+
downloader.authenticator = nca_login
|
96
|
+
response = downloader.download(file_id)
|
97
|
+
|
98
|
+
status = response.get("workable_state")
|
99
|
+
if status != "ready":
|
100
|
+
test_response.success = False
|
101
|
+
test_response.error = f"File conversion failed. Status: {status}"
|
102
|
+
else:
|
103
|
+
test_response.success = True
|
104
|
+
|
105
|
+
test_response.response = response
|
106
|
+
|
107
|
+
return response
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
Copyright 2024 Aplos Analytics
|
2
|
+
Copyright 2024-2025 Aplos Analytics
|
3
3
|
All Rights Reserved. www.aplosanalytics.com LICENSED MATERIALS
|
4
4
|
Property of Aplos Analytics, Utah, USA
|
5
5
|
"""
|
@@ -48,7 +48,7 @@ class NCAAnalysisTest(IntegrationTestBase):
|
|
48
48
|
try:
|
49
49
|
# Create new NCA Execution
|
50
50
|
nca_execution: NCAAnalysis = NCAAnalysis(
|
51
|
-
nca_execution_config.login.
|
51
|
+
nca_execution_config.login.host
|
52
52
|
)
|
53
53
|
|
54
54
|
# Initialize Configuration Data
|