aplos-nca-saas-sdk 0.0.12__tar.gz → 0.0.14__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.
Files changed (72) hide show
  1. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/.gitignore +3 -1
  2. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/LICENSE +1 -1
  3. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/PKG-INFO +1 -1
  4. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/pyproject.toml +1 -1
  5. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/configs/_config_base.py +7 -2
  6. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings_config.py +88 -0
  7. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/configs/config_sample.json +10 -10
  8. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/configs/file_upload_config.py +1 -1
  9. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/configs/login_config.py +15 -14
  10. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/configs/nca_execution_config.py +1 -1
  11. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/integration_test_base.py +2 -2
  12. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py +9 -5
  13. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +1 -1
  14. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/integration_test_response.py +1 -1
  15. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +10 -3
  16. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/main.py +9 -8
  17. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/readme.md +1 -1
  18. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +4 -4
  19. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +3 -3
  20. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +107 -0
  21. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/tests/nca_analysis_test.py +2 -2
  22. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/tests/validation_test.py +1 -1
  23. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/_api_base.py +44 -0
  24. {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources}/aws_cognito.py +2 -2
  25. {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources}/aws_s3_presigned_payload.py +3 -3
  26. {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/aws_resources → aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources}/aws_s3_presigned_upload.py +28 -22
  27. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/nca_resources/nca_analysis.py +23 -167
  28. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py +4 -4
  29. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_login.py → aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/nca_authenticator.py +23 -20
  30. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +84 -0
  31. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/nca_file_download.py +130 -0
  32. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +55 -0
  33. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/nca_resources/nca_validations.py +34 -0
  34. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/run_analysis_execution.py +148 -0
  35. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/utilities/commandline_args.py +29 -13
  36. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/utilities/environment_services.py +3 -2
  37. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/utilities/environment_vars.py +10 -4
  38. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/utilities/file_utility.py +1 -1
  39. aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/utilities/http_utility.py +21 -0
  40. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/version.py +1 -1
  41. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/integration_testing/configs/app_settings_config.py +0 -88
  42. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/integration_testing/tests/file_upload_test.py +0 -158
  43. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_endpoints.py +0 -58
  44. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/nca_resources/nca_file_upload.py +0 -57
  45. aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/utilities/http_utility.py +0 -46
  46. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/.pypirc +0 -0
  47. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/.vscode/launch.json +0 -0
  48. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/.vscode/settings.json +0 -0
  49. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/README.md +0 -0
  50. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/devops/pypi/build.py +0 -0
  51. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/devops/pypi/readme.md +0 -0
  52. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/devops/requirements.txt +0 -0
  53. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/docs/images/API_Configuration_blur.png +0 -0
  54. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/docs/images/aplos-nca-commandline-cropped.png +0 -0
  55. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/docs/images/aplos-nca-commandline.png +0 -0
  56. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/mypy.ini +0 -0
  57. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/mypy_checks.py +0 -0
  58. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/readme.md +0 -0
  59. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/requirements.txt +0 -0
  60. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/run-checks.sh +0 -0
  61. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/__init__.py +0 -0
  62. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/executions/config1.json +0 -0
  63. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.csv +0 -0
  64. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.dat +0 -0
  65. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.sas7bdat +0 -0
  66. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xls +0 -0
  67. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xlsx +0 -0
  68. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/src/aplos_nca_saas_sdk/integration_testing/files/uploads/input1.xpt +0 -0
  69. /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.14/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/config.json +0 -0
  70. /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.14/src/aplos_nca_saas_sdk/sample_files/analysis_files/single_ev/input.csv +0 -0
  71. {aplos_nca_saas_sdk-0.0.12/src/aplos_nca_saas_sdk/files → aplos_nca_saas_sdk-0.0.14/src/aplos_nca_saas_sdk/sample_files}/analysis_files/single_ev/meta_data.json +0 -0
  72. {aplos_nca_saas_sdk-0.0.12 → aplos_nca_saas_sdk-0.0.14}/tests/__init__.py +0 -0
@@ -12,4 +12,6 @@ dist/
12
12
  .env
13
13
  .env.*
14
14
  .config.*
15
- .aplos-nca-output
15
+ # exclude any output generated
16
+ .aplos-nca-output
17
+ .output
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) [year] [fullname]
3
+ Copyright (c) 2024-2025 Aplos Analytics
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aplos_nca_saas_sdk
3
- Version: 0.0.12
3
+ Version: 0.0.14
4
4
  Summary: Aplos NCA SaaS SDK
5
5
  Project-URL: Homepage, https://aplosanalytics.com/
6
6
  Project-URL: Documentation, https://docs.aplosanalytics.com/
@@ -26,7 +26,7 @@ keywords = [
26
26
  "Clinical Trials"
27
27
  ]
28
28
 
29
- version = "0.0.12"
29
+ version = "0.0.14"
30
30
  authors = [
31
31
  { name="Eric Wilson", email="eric.wilson@aplosanalytics.com" }
32
32
  ]
@@ -1,5 +1,10 @@
1
- from typing import Dict
2
- from typing import Any
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:
@@ -0,0 +1,88 @@
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 List, Dict, Any
8
+ from aplos_nca_saas_sdk.integration_testing.configs._config_base import ConfigBase
9
+
10
+
11
+ class ApplicationHostConfig(ConfigBase):
12
+ """
13
+ Application host: Defines the hosts that the application configuration tests will check against
14
+
15
+ """
16
+
17
+ def __init__(self, host: str | None = None):
18
+ super().__init__()
19
+ self.__host: str | None = host
20
+
21
+ @property
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
+
28
+ @host.setter
29
+ def host(self, value: str):
30
+ self.__host = value
31
+
32
+
33
+ class ApplicationHostConfigs(ConfigBase):
34
+ """
35
+ Application ApplicationHost: Defines the hosts that the application configuration tests will check against
36
+
37
+ """
38
+
39
+ def __init__(self):
40
+ super().__init__()
41
+ self.__hosts: List[ApplicationHostConfig] = []
42
+
43
+ @property
44
+ def list(self) -> List[ApplicationHostConfig]:
45
+ """List the logins"""
46
+ return self.__hosts
47
+
48
+ def add(self, *, host: str, enabled: bool = True):
49
+ """Add a loging"""
50
+ app_domain = ApplicationHostConfig()
51
+ app_domain.host = host
52
+ app_domain.enabled = enabled
53
+ self.__hosts.append(app_domain)
54
+
55
+ def load(self, test_config: Dict[str, Any]):
56
+ """Load the logins from a list of dictionaries"""
57
+ # self.enabled = bool(test_config.get("enabled", True))
58
+ super().load(test_config)
59
+ hosts: List[Dict[str, Any]] = test_config.get("hosts", [])
60
+
61
+ host: Dict[str, Any]
62
+ for host in hosts:
63
+ app_domain = ApplicationHostConfig()
64
+ app_domain.host = host.get("host", None)
65
+ app_domain.enabled = bool(host.get("enabled", True))
66
+
67
+ self.__hosts.append(app_domain)
68
+
69
+
70
+ class ApplicationSettings(ConfigBase):
71
+ """
72
+ Application Settings: Defines the hosts that the application settings (configuration endpoint) tests will check against
73
+
74
+ """
75
+
76
+ def __init__(self):
77
+ super().__init__()
78
+ self.__hosts: ApplicationHostConfigs = ApplicationHostConfigs()
79
+
80
+ @property
81
+ def hosts(self) -> ApplicationHostConfigs:
82
+ """List of the host"""
83
+ return self.__hosts
84
+
85
+ def load(self, test_config: Dict[str, Any]):
86
+ """Load the hosts from the config"""
87
+ super().load(test_config)
88
+ self.hosts.load(test_config)
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "application_config_test": {
3
3
  "purpose": "Tests the application configuration endpoints",
4
- "domains": [
4
+ "hosts": [
5
5
  {
6
- "domain": "api.example.com",
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
- "domain": "XXXXXXXXXXXXXXXXXXXXX",
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
- "domain": "api.example.com",
27
+ "host": "api.example.com",
28
28
  "roles": []
29
29
  },
30
30
  {
31
31
  "username": "XXXXXXXXXXXXXXXXXXXXX",
32
32
  "password": "XXXXXXXXXXXXXXXXXXXXX",
33
- "domain": "XXXXXXXXXXXXXXXXXXXXX",
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
- "domain": "api.example.com"
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
- "domain": "XXXXXXXXXXXXXXXXXXXXX"
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
- "domain": "XXXXXXXXXXXXXXXXXXXXX"
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
- "domain": "XXXXXXXXXXXXXXXXXXXXX"
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
- "domain": "XXXXXXXXXXXXXXXXXXXXX"
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
  """
@@ -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
- domain: Optional[str] = None,
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.__domain: Optional[str] = domain
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 domain(self) -> str:
52
- if self.__domain is None:
53
- raise RuntimeError("Domain is not set")
54
- return self.__domain
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
- @domain.setter
57
- def domain(self, value: str):
58
- self.__domain = value
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, domain: str, enabled: bool = True):
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.domain = domain
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
- domain = login_config.get("domain", None)
115
+ host = login_config.get("host", None)
115
116
  enabled = login_config.get("enabled", True)
116
- login = LoginConfig(username, password, domain)
117
+ login = LoginConfig(username, password, host)
117
118
  login.enabled = enabled
118
119
  return login
@@ -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
  """
@@ -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 FileUploadConfigs
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 NCAExecutionConfigs
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
  """
@@ -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
  """
@@ -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
- domain = os.getenv("TEST_DOMAIN")
50
+ host = os.getenv("TEST_HOST")
50
51
 
51
- if not username or not password or not domain:
52
+ if not username or not password or not host:
52
53
  raise RuntimeError(
53
- "TEST_USERNAME, TEST_PASSWORD, and TEST_DOMAIN must be set in the environment"
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, domain=domain)
58
+ config.logins.add(username=username, password=password, host=host)
58
59
 
59
- config.app_config.domains.list.clear()
60
- config.app_config.domains.add(domain=domain)
60
+ config.app_config.hosts.list.clear()
61
+ config.app_config.hosts.add(host=host)
61
62
 
62
63
 
63
64
  if __name__ == "__main__":
@@ -9,7 +9,7 @@ The integration tests will require the following:
9
9
  ### Environment Vars
10
10
  |Variable Name|Description|
11
11
  |--|--|
12
- |APLOS_API_DOMAIN|The full domain. e.g. app.aplos-nca.com|
12
+ |APLOS_host|The full host name. e.g. app.aplos-nca.com|
13
13
 
14
14
 
15
15
  ### Users
@@ -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
  """
@@ -26,11 +26,11 @@ class TestAppConfiguration(IntegrationTestBase):
26
26
  """Test loading the application configuration"""
27
27
 
28
28
  self.results.clear()
29
- for domain_config in self.config.app_config.domains.list:
30
- config: NCAAppConfiguration = NCAAppConfiguration(domain_config.domain)
29
+ for domain_config in self.config.app_config.hosts.list:
30
+ config: NCAAppConfiguration = NCAAppConfiguration(domain_config.host)
31
31
 
32
32
  test_response: IntegrationTestResponse = IntegrationTestResponse()
33
- test_response.meta = {"domain": domain_config}
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.nca_login import NCALogin
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 = NCALogin(aplos_saas_domain=login.domain)
38
+ nca_login = NCAAuthenticator(host=login.host)
39
39
  token = nca_login.authenticate(
40
40
  username=login.username, password=login.password
41
41
  )
@@ -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.domain
51
+ nca_execution_config.login.host
52
52
  )
53
53
 
54
54
  # Initialize Configuration Data
@@ -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
  """