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

Dpl 753 2 process qc fields #42

Merged
merged 8 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions .github/workflows/automated_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- develop
- master
- dpl-753-2-process-qc-fields
Sangeetha-Bheeman marked this conversation as resolved.
Show resolved Hide resolved

env:
IMAGE_NAME: ${{ github.repository }}/${{ github.event.repository.name }}
Expand Down
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.1-UAT5
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ def test_CountryOfOrigin_check_CountryOfOrigin_is_valid():
assert instance.validate() is False
assert len(instance.errors) > 0

instance = CountryOfOrigin(Input("United Kingdom"))
instance = CountryOfOrigin(Input("UNITED KINGDOM"))
assert instance.validate() is True
assert len(instance.errors) == 0
2 changes: 1 addition & 1 deletion tests/message_properties/definitions/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,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) == 14
assert len(instance.errors) == 15
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CountryOfOrigin(MessageProperty):
"""MessageProperty subclass to manage parsing of a valid country of origin provided by another
MessageProperty. The concentration has to be a country string from the list provided in
MessageProperty. The country has to be a country string from the list provided in
tol_lab_share.config.insdc.
Eg: 'Australia'
"""
Expand All @@ -25,10 +25,16 @@ def check_is_valid_country(self):
If that is not the case, it will trigger an error (not valid country insdc).
"""
logger.debug("CountryOfOrigin::check_is_valid_country")
result = False
if not self._input.validate():
return False
return result

if self.check_is_string():
for country in COUNTRIES:
if self._input.value.lower() == country.lower():
result = True
self._input.value = country

result = self._input.value in COUNTRIES
if not result:
self.trigger_error(error_codes.ERROR_4_NOT_VALID_COUNTRY_INSDC, text=f"input_value: {self._input.value}")
return result
Loading