Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier] DSS0030 let subscription_simple create subscriptions that don't set optional parameters #334

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def _check_subscription_behaviors(self):

# Delete the subscription
with self.check(
"Successful subscription deletion",
"Subscription can be deleted",
[self._dss.participant_id],
) as check:
self._dss_wrapper.del_sub(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,24 @@ def _create_and_validate_subs(self):
When this function returns, four subscriptions are expected to be created at the DSS
"""

# TODO the existing dss_wrapper put_sub function (and the underlying mutate.upsert_subscription it relies on)
# does not allow empty start/end times. We need to change that before we can test
# DSS behaviors with respect to missing optional parameters.

# no_opt_params = self._default_creation_params.copy()
# no_opt_params["sub_id"] = self._test_subscription_ids[0]
# del no_opt_params["start_time"]
# del no_opt_params["end_time"]
# self._create_sub_with_params(no_opt_params)
#
# no_start_param = self._default_creation_params.copy()
# no_start_param["sub_id"] = self._test_subscription_ids[1]
# del no_start_param["start_time"]
# self._create_sub_with_params(no_start_param)
#
# no_end_param = self._default_creation_params.copy()
# no_end_param["sub_id"] = self._test_subscription_ids[2]
# del no_end_param["end_time"]
# self._create_sub_with_params(no_start_param)
# Create the subscription without start and end time
no_opt_params = self._default_creation_params.copy()
no_opt_params["sub_id"] = self._test_subscription_ids[0]
no_opt_params["start_time"] = None
no_opt_params["end_time"] = None
self._create_sub_with_params(no_opt_params)

# Create the subscription with only end time set
no_start_param = self._default_creation_params.copy()
no_start_param["sub_id"] = self._test_subscription_ids[1]
no_start_param["start_time"] = None
self._create_sub_with_params(no_start_param)

# Create the subscription with only start time set
no_end_param = self._default_creation_params.copy()
no_end_param["sub_id"] = self._test_subscription_ids[2]
no_end_param["end_time"] = None
self._create_sub_with_params(no_end_param)

# Create the subscription with all parameters set:
all_set_params = self._default_creation_params.copy()
Expand Down Expand Up @@ -680,33 +679,39 @@ def _validate_subscription(
query_timestamps=query_timestamps,
)

with self.check(
"Returned start time is correct", [self._dss_wrapper.participant_id]
) as check:
if (
abs(sub_under_test.time_start - expect_start_time).total_seconds()
> TIME_TOLERANCE_SEC
):
check.record_failed(
"Returned start time does not match provided one",
Severity.High,
f"Provided: {expect_start_time}, Returned: {sub_under_test.time_start}",
query_timestamps=query_timestamps,
)
# When expect_start_time has not been defined, there is no clear specification on
# what the returned start time should be, so we only check it when we have requested one
if expect_start_time is not None:
with self.check(
"Returned start time is correct", [self._dss_wrapper.participant_id]
) as check:
if (
abs(sub_under_test.time_start - expect_start_time).total_seconds()
> TIME_TOLERANCE_SEC
):
check.record_failed(
"Returned start time does not match provided one",
Severity.High,
f"Provided: {expect_start_time}, Returned: {sub_under_test.time_start}",
query_timestamps=query_timestamps,
)

with self.check(
"Returned end time is correct", [self._dss_wrapper.participant_id]
) as check:
if (
abs(sub_under_test.time_end - expect_end_time).total_seconds()
> TIME_TOLERANCE_SEC
):
check.record_failed(
"Returned end time does not match provided one",
Severity.High,
f"Provided: {expect_end_time}, Returned: {sub_under_test.time_end}",
query_timestamps=query_timestamps,
)
# When expect_end_time has not been defined, there is no clear specification on
# what the returned end time should be, so we only check it when we have requested one
if expect_end_time is not None:
with self.check(
"Returned end time is correct", [self._dss_wrapper.participant_id]
) as check:
if (
abs(sub_under_test.time_end - expect_end_time).total_seconds()
> TIME_TOLERANCE_SEC
):
check.record_failed(
"Returned end time does not match provided one",
Severity.High,
f"Provided: {expect_end_time}, Returned: {sub_under_test.time_end}",
query_timestamps=query_timestamps,
)

with self.check(
"Returned subscription has a version", [self._dss_wrapper.participant_id]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

**[astm.f3411.v19.DSS0030,f](../../../../../requirements/astm/f3411/v19.md)** requires the implementation of the DSS endpoint to allow callers to retrieve the subscriptions they created.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v19.DSS0030,d](../../../../../requirements/astm/f3411/v19.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.

Expand Down Expand Up @@ -114,7 +114,7 @@ and return the up-to-date subscription in the response to the query deleting the

Failure to do so means that the DSS is not properly implementing **[astm.f3411.v19.DSS0030,a](../../../../../requirements/astm/f3411/v19.md)**.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v19.DSS0030,d](../../../../../requirements/astm/f3411/v19.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.

Expand Down Expand Up @@ -143,6 +143,6 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

**[astm.f3411.v19.DSS0030,f](../../../../../requirements/astm/f3411/v19.md)** requires the implementation of the DSS endpoint to allow callers to retrieve the subscriptions they created.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v19.DSS0030,d](../../../../../requirements/astm/f3411/v19.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

**[astm.f3411.v22a.DSS0030,f](../../../../../requirements/astm/f3411/v22a.md)** requires the implementation of the DSS endpoint to allow callers to retrieve the subscriptions they created.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v22a.DSS0030,d](../../../../../requirements/astm/f3411/v22a.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.

Expand Down Expand Up @@ -114,7 +114,7 @@ and return the up-to-date subscription in the response to the query deleting the

Failure to do so means that the DSS is not properly implementing **[astm.f3411.v22a.DSS0030,a](../../../../../requirements/astm/f3411/v22a.md)**.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v22a.DSS0030,d](../../../../../requirements/astm/f3411/v22a.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.

Expand Down Expand Up @@ -143,6 +143,6 @@ When a pre-existing ISA needs to be deleted to ensure a clean workspace, any sub

**[astm.f3411.v22a.DSS0030,f](../../../../../requirements/astm/f3411/v22a.md)** requires the implementation of the DSS endpoint to allow callers to retrieve the subscriptions they created.

#### Successful subscription deletion check
#### Subscription can be deleted check

**[astm.f3411.v22a.DSS0030,d](../../../../../requirements/astm/f3411/v22a.md)** requires the implementation of the DSS endpoint to allow callers to delete subscriptions they created.
Loading