aplos-nca-saas-sdk 0.0.5__py3-none-any.whl → 0.0.6__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.
- aplos_nca_saas_sdk/integration_testing/configs/app_settings.py +37 -9
- aplos_nca_saas_sdk/integration_testing/configs/login.py +2 -1
- aplos_nca_saas_sdk/integration_testing/integration_test_base.py +1 -1
- aplos_nca_saas_sdk/integration_testing/integration_test_factory.py +3 -3
- aplos_nca_saas_sdk/integration_testing/integration_test_response.py +2 -0
- aplos_nca_saas_sdk/integration_testing/integration_test_suite.py +8 -2
- aplos_nca_saas_sdk/integration_testing/main.py +2 -2
- aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py +7 -1
- aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py +4 -0
- aplos_nca_saas_sdk/version.py +1 -1
- {aplos_nca_saas_sdk-0.0.5.dist-info → aplos_nca_saas_sdk-0.0.6.dist-info}/METADATA +1 -1
- {aplos_nca_saas_sdk-0.0.5.dist-info → aplos_nca_saas_sdk-0.0.6.dist-info}/RECORD +14 -14
- {aplos_nca_saas_sdk-0.0.5.dist-info → aplos_nca_saas_sdk-0.0.6.dist-info}/WHEEL +0 -0
- {aplos_nca_saas_sdk-0.0.5.dist-info → aplos_nca_saas_sdk-0.0.6.dist-info}/licenses/LICENSE +0 -0
@@ -14,9 +14,9 @@ class ApplicationDomain(ConfigBase):
|
|
14
14
|
|
15
15
|
"""
|
16
16
|
|
17
|
-
def __init__(self):
|
17
|
+
def __init__(self, domain: str | None = None):
|
18
18
|
super().__init__()
|
19
|
-
self.__domain: str | None =
|
19
|
+
self.__domain: str | None = domain
|
20
20
|
|
21
21
|
@property
|
22
22
|
def domain(self) -> str:
|
@@ -30,25 +30,32 @@ class ApplicationDomain(ConfigBase):
|
|
30
30
|
self.__domain = value
|
31
31
|
|
32
32
|
|
33
|
-
class
|
33
|
+
class ApplicationDomains(ConfigBase):
|
34
34
|
"""
|
35
|
-
Application
|
35
|
+
Application ApplicationDomain: Defines the Domains that the application configuration tests will check against
|
36
36
|
|
37
37
|
"""
|
38
38
|
|
39
39
|
def __init__(self):
|
40
|
+
super().__init__()
|
40
41
|
self.__domains: List[ApplicationDomain] = []
|
41
42
|
|
42
43
|
@property
|
43
|
-
def
|
44
|
+
def list(self) -> List[ApplicationDomain]:
|
45
|
+
"""List the logins"""
|
44
46
|
return self.__domains
|
45
47
|
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
def add(self, *, domain: str, enabled: bool = True):
|
49
|
+
"""Add a loging"""
|
50
|
+
app_domain = ApplicationDomain()
|
51
|
+
app_domain.domain = domain
|
52
|
+
app_domain.enabled = enabled
|
53
|
+
self.__domains.append(app_domain)
|
49
54
|
|
50
55
|
def load(self, test_config: Dict[str, Any]):
|
51
|
-
"""Load the
|
56
|
+
"""Load the logins from a list of dictionaries"""
|
57
|
+
# self.enabled = bool(test_config.get("enabled", True))
|
58
|
+
super().load(test_config)
|
52
59
|
domains: List[Dict[str, Any]] = test_config.get("domains", [])
|
53
60
|
|
54
61
|
domain: Dict[str, Any]
|
@@ -58,3 +65,24 @@ class ApplicationSettings:
|
|
58
65
|
app_domain.enabled = bool(domain.get("enabled", True))
|
59
66
|
|
60
67
|
self.__domains.append(app_domain)
|
68
|
+
|
69
|
+
|
70
|
+
class ApplicationSettings(ConfigBase):
|
71
|
+
"""
|
72
|
+
Application Settings: Defines the domains that the application settings (configuration endpoint) tests will check against
|
73
|
+
|
74
|
+
"""
|
75
|
+
|
76
|
+
def __init__(self):
|
77
|
+
super().__init__()
|
78
|
+
self.__domains: ApplicationDomains = ApplicationDomains()
|
79
|
+
|
80
|
+
@property
|
81
|
+
def domains(self) -> ApplicationDomains:
|
82
|
+
"""List of the domain"""
|
83
|
+
return self.__domains
|
84
|
+
|
85
|
+
def load(self, test_config: Dict[str, Any]):
|
86
|
+
"""Load the domains from the config"""
|
87
|
+
super().load(test_config)
|
88
|
+
self.domains.load(test_config)
|
@@ -95,7 +95,8 @@ class Logins(ConfigBase):
|
|
95
95
|
|
96
96
|
def load(self, test_config: Dict[str, Any]):
|
97
97
|
"""Load the logins from a list of dictionaries"""
|
98
|
-
self.enabled = bool(test_config.get("enabled", True))
|
98
|
+
# self.enabled = bool(test_config.get("enabled", True))
|
99
|
+
super().load(test_config)
|
99
100
|
logins: List[Dict[str, str]] = test_config.get("logins", [])
|
100
101
|
for login in logins:
|
101
102
|
self.add(
|
@@ -22,7 +22,7 @@ class IntegrationTestBase:
|
|
22
22
|
def __init__(self, name: str | None = None, index: int = 0):
|
23
23
|
self.name = name
|
24
24
|
self.index = index
|
25
|
-
self.__config: TestConfiguration
|
25
|
+
self.__config: TestConfiguration = TestConfiguration()
|
26
26
|
self.__results: List[IntegrationTestResponse] = []
|
27
27
|
|
28
28
|
@property
|
@@ -49,14 +49,14 @@ class IntegrationTestFactory:
|
|
49
49
|
and obj is not IntegrationTestBase
|
50
50
|
):
|
51
51
|
# Instantiate the class and store it
|
52
|
-
self.
|
52
|
+
self.register_test_instance(obj())
|
53
53
|
|
54
54
|
@property
|
55
|
-
def
|
55
|
+
def test_instances(self) -> List[IntegrationTestBase]:
|
56
56
|
"""Get the test classes"""
|
57
57
|
self.__test_classes.sort(key=lambda x: x.index)
|
58
58
|
return self.__test_classes
|
59
59
|
|
60
|
-
def
|
60
|
+
def register_test_instance(self, test_class: IntegrationTestBase):
|
61
61
|
"""Register a test class"""
|
62
62
|
self.__test_classes.append(test_class)
|
@@ -16,6 +16,7 @@ class IntegrationTestResponse:
|
|
16
16
|
self.response: Dict[str, Any] = {}
|
17
17
|
self.error: Optional[str] = None
|
18
18
|
self.success: bool = False
|
19
|
+
self.skipped: bool = False
|
19
20
|
|
20
21
|
def to_dict(self) -> Dict[str, Any]:
|
21
22
|
"""JSON Dictionary Object"""
|
@@ -25,4 +26,5 @@ class IntegrationTestResponse:
|
|
25
26
|
"response": self.response,
|
26
27
|
"error": self.error,
|
27
28
|
"success": self.success,
|
29
|
+
"skipped": self.skipped,
|
28
30
|
}
|
@@ -38,21 +38,24 @@ class IntegrationTestSuite:
|
|
38
38
|
start_time: datetime = datetime.now(UTC)
|
39
39
|
factory: IntegrationTestFactory = IntegrationTestFactory()
|
40
40
|
test: IntegrationTestBase | None = None
|
41
|
-
for test in factory.
|
41
|
+
for test in factory.test_instances:
|
42
42
|
test.config = test_config
|
43
43
|
test_result: Dict[str, Any] = {
|
44
44
|
"test_name": test.name,
|
45
45
|
"success": True,
|
46
46
|
"error": None,
|
47
|
-
"
|
47
|
+
"skipped": False,
|
48
|
+
"start_time_utc": None,
|
48
49
|
"end_time_utc": None,
|
49
50
|
}
|
50
51
|
|
51
52
|
logger.info(f"Running test class {test.name}")
|
52
53
|
try:
|
54
|
+
test_result["start_time_utc"] = datetime.now(UTC)
|
53
55
|
success = test.test()
|
54
56
|
test_result["success"] = success
|
55
57
|
test_result["results"] = test.results
|
58
|
+
|
56
59
|
except Exception as e: # pylint: disable=broad-except
|
57
60
|
test_result["success"] = False
|
58
61
|
test_result["error"] = str(e)
|
@@ -96,3 +99,6 @@ class IntegrationTestSuite:
|
|
96
99
|
print(f"Total Tests: {len(self.test_results)}")
|
97
100
|
print(f"Successful Tests: {len(self.test_results) - len(failures)}")
|
98
101
|
print(f"Failed Tests: {len(failures)}")
|
102
|
+
print(
|
103
|
+
f"Skipped Tests: {len([test for test in self.test_results if test['skipped']])}"
|
104
|
+
)
|
@@ -53,8 +53,8 @@ def override_config(config: TestConfiguration):
|
|
53
53
|
config.logins.list.clear()
|
54
54
|
config.logins.add(username=username, password=password, domain=domain)
|
55
55
|
|
56
|
-
config.app_config.domains.clear()
|
57
|
-
config.app_config.domains.
|
56
|
+
config.app_config.domains.list.clear()
|
57
|
+
config.app_config.domains.add(domain=domain)
|
58
58
|
|
59
59
|
|
60
60
|
if __name__ == "__main__":
|
@@ -26,11 +26,17 @@ 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:
|
29
|
+
for domain_config in self.config.app_config.domains.list:
|
30
30
|
config: NCAAppConfiguration = NCAAppConfiguration(domain_config.domain)
|
31
31
|
|
32
32
|
test_response: IntegrationTestResponse = IntegrationTestResponse()
|
33
33
|
test_response.meta = {"domain": domain_config}
|
34
|
+
|
35
|
+
if not domain_config.enabled or not self.config.app_config.enabled:
|
36
|
+
test_response.skipped = True
|
37
|
+
self.results.append(test_response)
|
38
|
+
continue
|
39
|
+
|
34
40
|
try:
|
35
41
|
response = config.get()
|
36
42
|
test_response.response = response
|
@@ -29,6 +29,10 @@ class TestAppLogin(IntegrationTestBase):
|
|
29
29
|
for login in self.config.logins.list:
|
30
30
|
test_response: IntegrationTestResponse = IntegrationTestResponse()
|
31
31
|
test_response.name = self.name
|
32
|
+
if not login.enabled or not self.config.logins.enabled:
|
33
|
+
test_response.skipped = True
|
34
|
+
self.results.append(test_response)
|
35
|
+
continue
|
32
36
|
try:
|
33
37
|
nca_login = NCALogin(aplos_saas_domain=login.domain)
|
34
38
|
token = nca_login.authenticate(
|
aplos_nca_saas_sdk/version.py
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
aplos_nca_saas_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
aplos_nca_saas_sdk/version.py,sha256=
|
2
|
+
aplos_nca_saas_sdk/version.py,sha256=DHvdN6l39RUqrAnGfx8PwpFxsXPlEjWYlNsEZWFzU-0,171
|
3
3
|
aplos_nca_saas_sdk/aws_resources/aws_cognito.py,sha256=pxyEdIoeeT7of_hjxYlplOnyLQpo3I-dnc5mHeGP47c,6427
|
4
4
|
aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_payload.py,sha256=rbTaeUgPpRsw1KV0YjnmkD5sQvlYet9XBj6Ie7nXz5Y,1987
|
5
5
|
aplos_nca_saas_sdk/aws_resources/aws_s3_presigned_upload.py,sha256=WK7CKzuHcgU15k2BWiBqSZ8UdQSVSo39L8Las-7gvC0,3940
|
6
6
|
aplos_nca_saas_sdk/files/analysis_files/single_ev/configuration_single_ev.json,sha256=lLnRV0jwzaSn32D8NlOekOF5oGFfUwugUlvlwoKz540,986
|
7
7
|
aplos_nca_saas_sdk/files/analysis_files/single_ev/meta_data.json,sha256=p1KYOAe5Cl3rjtfF1t96oRG-QtFJJCo9otReRPNtvIk,447
|
8
8
|
aplos_nca_saas_sdk/files/analysis_files/single_ev/single_ev.csv,sha256=qFSAlgLOmERsabMmp1X6PAZa-8yFthZlHacM_f7_AOY,6528
|
9
|
-
aplos_nca_saas_sdk/integration_testing/integration_test_base.py,sha256=
|
9
|
+
aplos_nca_saas_sdk/integration_testing/integration_test_base.py,sha256=UOwfhcgX3YrDRfKhxemTo2gKNCJVzZ4RT-RMMDhzozI,2008
|
10
10
|
aplos_nca_saas_sdk/integration_testing/integration_test_configurations.py,sha256=ZE-Yqm8v7QPOPENmcVIksniFhikndHWVB21HkQspupE,1100
|
11
|
-
aplos_nca_saas_sdk/integration_testing/integration_test_factory.py,sha256=
|
12
|
-
aplos_nca_saas_sdk/integration_testing/integration_test_response.py,sha256=
|
13
|
-
aplos_nca_saas_sdk/integration_testing/integration_test_suite.py,sha256=
|
14
|
-
aplos_nca_saas_sdk/integration_testing/main.py,sha256=
|
11
|
+
aplos_nca_saas_sdk/integration_testing/integration_test_factory.py,sha256=NNDmBlDNPJWylXeygiXMyIGl29-DykZ8btx4a6RwjiY,2089
|
12
|
+
aplos_nca_saas_sdk/integration_testing/integration_test_response.py,sha256=T5cLdrhN9Dncu3SFZ3JpUnpQGGJ_VpvTO3uEz0KjfY0,814
|
13
|
+
aplos_nca_saas_sdk/integration_testing/integration_test_suite.py,sha256=r91p9Nz_cffgc2PJy_9nou9nJxY9ya8GyjzhyieGbGE,3806
|
14
|
+
aplos_nca_saas_sdk/integration_testing/main.py,sha256=5vY3CHhQeGgCZW28fz5lhsM5zpNXrmnvLn0kU8AjLPc,1985
|
15
15
|
aplos_nca_saas_sdk/integration_testing/readme.md,sha256=sX-_gzx17UUF-ZqvCWq0R5zcqgOMC4JjQKnjgxQH9vM,629
|
16
16
|
aplos_nca_saas_sdk/integration_testing/configs/_config_base.py,sha256=O48Y1r8JFe2KvSMTY5EttZAz1-hQsU6-Su6CzDUKDmE,347
|
17
|
-
aplos_nca_saas_sdk/integration_testing/configs/app_settings.py,sha256=
|
17
|
+
aplos_nca_saas_sdk/integration_testing/configs/app_settings.py,sha256=qq04xPowq4-4EY0Cf8zzVqmgUfrHk3RAtHOOcyFifEw,2618
|
18
18
|
aplos_nca_saas_sdk/integration_testing/configs/config_sample.json,sha256=50tqWe9OpD1b-EWe2_wQlwYtQ0n_OqfwobFkRraoxwc,3328
|
19
|
-
aplos_nca_saas_sdk/integration_testing/configs/login.py,sha256=
|
20
|
-
aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py,sha256=
|
19
|
+
aplos_nca_saas_sdk/integration_testing/configs/login.py,sha256=DGcjH4WuyG0oPxdIJBi3qpymzGaLEJjCoRfbQT0PcK4,3002
|
20
|
+
aplos_nca_saas_sdk/integration_testing/tests/app_configuration_test.py,sha256=rayFz4YcSpBVXr9aZYQSncBg7ohdYjEZpxIc1P7vrNA,1568
|
21
21
|
aplos_nca_saas_sdk/integration_testing/tests/app_execution_test.py,sha256=bDyVvtOKSJdy0sdCVYVuCdUrQYhn8D3peCmM1OCkSVg,145
|
22
|
-
aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py,sha256=
|
22
|
+
aplos_nca_saas_sdk/integration_testing/tests/app_login_test.py,sha256=7aid5Fz9Je8e3zAVg-vl_DEC3-vBzPXgLJ2EVhUeFZc,1637
|
23
23
|
aplos_nca_saas_sdk/integration_testing/tests/app_validation_test.py,sha256=bDyVvtOKSJdy0sdCVYVuCdUrQYhn8D3peCmM1OCkSVg,145
|
24
24
|
aplos_nca_saas_sdk/nca_resources/nca_app_configuration.py,sha256=mRK_OK2k0q4o4pH11tpeR3yKve7sgw3XTtQ0HG9KKFU,1877
|
25
25
|
aplos_nca_saas_sdk/nca_resources/nca_endpoints.py,sha256=8jQK8mniRFaQaGnpG1g_D0si8HCJciVvcLA6wFtOers,2026
|
@@ -29,7 +29,7 @@ aplos_nca_saas_sdk/utilities/commandline_args.py,sha256=WKIPNKMMMpEk580xXMQY7sGw
|
|
29
29
|
aplos_nca_saas_sdk/utilities/environment_services.py,sha256=K6xnxDb9eNdmjJZKPW0JfmmV9rGGwm2urlxCBZwxMMs,2272
|
30
30
|
aplos_nca_saas_sdk/utilities/environment_vars.py,sha256=pfcfX2eYmwYrmY-PZIHCONU9ds_-6GZmb-JibGROJGI,812
|
31
31
|
aplos_nca_saas_sdk/utilities/http_utility.py,sha256=7VGWeSOuJbjnUQkzNA6cquKv0g2FJoHsBnDSgE2Buic,696
|
32
|
-
aplos_nca_saas_sdk-0.0.
|
33
|
-
aplos_nca_saas_sdk-0.0.
|
34
|
-
aplos_nca_saas_sdk-0.0.
|
35
|
-
aplos_nca_saas_sdk-0.0.
|
32
|
+
aplos_nca_saas_sdk-0.0.6.dist-info/METADATA,sha256=wkxK4Uynln-5Dpg4j4aw28Kvc1EsghyrGkmZLWB1aTU,3769
|
33
|
+
aplos_nca_saas_sdk-0.0.6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
34
|
+
aplos_nca_saas_sdk-0.0.6.dist-info/licenses/LICENSE,sha256=pAZXnNE2dxxwXFIduGyn1gpvPefJtUYOYZOi3yeGG94,1068
|
35
|
+
aplos_nca_saas_sdk-0.0.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|