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

Removed volume and concentration checking is float #43

Merged
merged 1 commit into from
Sep 14, 2023
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
4 changes: 1 addition & 3 deletions tests/message_properties/definitions/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def test_sample_is_invalid(invalid_sample):
check_presence_error(instance.errors, error_codes.ERROR_1_UUID_NOT_BINARY, "study_uuid")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "study_uuid")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "common_name")
check_presence_error(instance.errors, error_codes.ERROR_20_INPUT_IS_NOT_VALID_FLOAT_STRING, "concentration")
check_presence_error(instance.errors, error_codes.ERROR_20_INPUT_IS_NOT_VALID_FLOAT_STRING, "volume")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "country_of_origin")
check_presence_error(instance.errors, error_codes.ERROR_4_NOT_VALID_COUNTRY_INSDC, "country_of_origin")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "donor_id")
Expand All @@ -55,4 +53,4 @@ def test_sample_is_invalid(invalid_sample):
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "cost_code")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "final_nano_drop_280")
check_presence_error(instance.errors, error_codes.ERROR_2_NOT_STRING, "final_nano_drop_230")
assert len(instance.errors) == 15
assert len(instance.errors) == 13
2 changes: 1 addition & 1 deletion tests/messages/test_input_create_labware_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_input_create_labware_message_can_validate_when_valid(valid_create_labwa
def test_input_create_labware_message_can_validate_when_invalid(invalid_create_labware_message):
instance = InputCreateLabwareMessage(invalid_create_labware_message)
assert instance.validate() is False
assert len(instance.errors) == 9
assert len(instance.errors) == 5


def test_input_create_labware_message_can_add_to_feedback_message_if_invalid(invalid_create_labware_message):
Expand Down
24 changes: 0 additions & 24 deletions tests/processors/test_create_labware_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ def test_create_labware_processor_with_invalid_input_triggers_error(
" text: \"input: b'b01aa0ad7b19-4f94-87e9-70d74fb8783c'\""
),
},
{
"typeId": 20,
"field": "concentration",
"origin": "sample",
"description": 'The input provided is not a valid float., instance: "Concentration"',
},
{
"typeId": 20,
"field": "volume",
"origin": "sample",
"description": 'The input provided is not a valid float., instance: "Volume"',
},
{
"typeId": 7,
"field": "location",
Expand All @@ -125,18 +113,6 @@ def test_create_labware_processor_with_invalid_input_triggers_error(
"origin": "sample",
"description": 'Not string, instance: "FinalNanoDrop"',
},
{
"typeId": 20,
"field": "concentration",
"origin": "sample",
"description": 'The input provided is not a valid float., instance: "Concentration"',
},
{
"typeId": 20,
"field": "volume",
"origin": "sample",
"description": 'The input provided is not a valid float., instance: "Volume"',
},
{
"typeId": 7,
"field": "location",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class Concentration(MessageProperty):
@property
def validators(self) -> List[Callable]:
"""Defines the list of validators"""
return [self.check_is_float_string]
return [self.check_is_string]
2 changes: 1 addition & 1 deletion tol_lab_share/message_properties/definitions/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class Volume(MessageProperty):
@property
def validators(self) -> List[Callable]:
"""Defines the list of validators"""
return [self.check_is_float_string]
return [self.check_is_string]
Loading