Skip to content

Commit

Permalink
removing match case (openMetadataInitiative#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyman-N authored Jun 21, 2024
1 parent 7edd2c2 commit a7f3673
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions test/test_subject_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
(45, "QuantitativeValue"), ("XX", None)]


@ pytest.mark.parametrize("age,type", example_ages)
def test_subject_age(age, type):
@ pytest.mark.parametrize("age,age_type", example_ages)
def test_subject_age(age, age_type):
data_subject_table = pd.DataFrame(data={'age': [age]})
openminds_age = create_openminds_age(data_subject_table)
match type:
case "QuantitativeValueRange":
assert openminds_age.type_ == 'https://openminds.ebrains.eu/core/QuantitativeValueRange'
assert openminds_age.max_value is None
assert openminds_age.min_value == 89
case "QuantitativeValue":
assert openminds_age.type_ == 'https://openminds.ebrains.eu/core/QuantitativeValue'
assert openminds_age.value == age
case None:
assert openminds_age is None
if age_type == "QuantitativeValueRange":
assert openminds_age.type_ == 'https://openminds.ebrains.eu/core/QuantitativeValueRange'
assert openminds_age.max_value is None
assert openminds_age.min_value == 89
if age_type == "QuantitativeValue":
assert openminds_age.type_ == 'https://openminds.ebrains.eu/core/QuantitativeValue'
assert openminds_age.value == age
if age_type == None:
assert openminds_age is None

0 comments on commit a7f3673

Please sign in to comment.