Skip to content

Commit

Permalink
Add additional test for manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanFauble committed Dec 3, 2024
1 parent f43cd28 commit 6eeacd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/data/example_test_nones.model.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Sex,,,"Female, Male, Other",,,TRUE,DataProperty,,
Year of Birth,,,,,,FALSE,DataProperty,,
Diagnosis,,,"Healthy, Cancer",,,TRUE,DataProperty,,
Cancer,,,,"Cancer Type, Family History",,FALSE,ValidValue,,
Cancer Type,,,"Breast, Colorectal, Lung, Prostate, Skin",,,TRUE,DataProperty,,
Cancer Type,,,"Breast, Colorectal, Lung, Prostate, Skin, None",,,TRUE,DataProperty,,
Family History,list strict,,"Breast, Colorectal, Lung, Prostate, Skin",,,TRUE,DataProperty,,
Biospecimen,,,,"Sample ID, Patient ID, Tissue Status, Component",,FALSE,DataType,Patient,
Sample ID,,,,,,TRUE,DataProperty,,
Expand Down
10 changes: 5 additions & 5 deletions tests/data/mock_manifests/Valid_Test_Manifest_with_nones.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Component,Check List,Check List Enum,Check List Like,Check List Like Enum,Check List Strict,Check List Enum Strict,Check Regex List,Check Regex List Like,Check Regex List Strict,Check Regex Single,Check Regex Format,Check Regex Integer,Check Num,Check Float,Check Int,Check String,Check URL,Check Match at Least,Check Match at Least values,Check Match Exactly,Check Match Exactly values,Check Recommended,Check Ages,Check Unique,Check Range,Check Date,Check NA
MockComponent,"ab,cd","ab,cd",ab,ab,"ab,cd","ab,cd","a,c,f",a,"a,c,f",a,a,,6,99.65,7,valid,https://www.google.com/,1738,1738,8085,8085,,6571,str1,75,10/21/2022,Not Applicable
MockComponent,"ab,cd","ab,cd",,,"ab,cd","ab,cd","a,c,f","a,c,f","a,c,f",,b,1234,71,58.4,3,valid,https://www.google.com/,9965,9965,9965,9965,,6571,str2,80,October 21 2022,8
MockComponent,,,,,,,,,,b,,683902,,,,,,,,,,present,,,,,
MockComponent,"ab,cd","ab,cd","ab,cd","ab,cd","ab,cd","ab,cd","b,d,f","b,d,f","b,d,f",b,c,0,6.5,62.3,2,valid,https://www.google.com/,79,79,7,7,,32849,str4,55,21/10/2022,695
Component,Cancer Type,Check List,Check List Enum,Check List Like,Check List Like Enum,Check List Strict,Check List Enum Strict,Check Regex List,Check Regex List Like,Check Regex List Strict,Check Regex Single,Check Regex Format,Check Regex Integer,Check Num,Check Float,Check Int,Check String,Check URL,Check Match at Least,Check Match at Least values,Check Match Exactly,Check Match Exactly values,Check Recommended,Check Ages,Check Unique,Check Range,Check Date,Check NA
MockComponent,None,"ab,cd","ab,cd",ab,ab,"ab,cd","ab,cd","a,c,f",a,"a,c,f",a,a,,6,99.65,7,valid,https://www.google.com/,1738,1738,8085,8085,,6571,str1,75,10/21/2022,Not Applicable
MockComponent,None,"ab,cd","ab,cd",,,"ab,cd","ab,cd","a,c,f","a,c,f","a,c,f",,b,1234,71,58.4,3,valid,https://www.google.com/,9965,9965,9965,9965,,6571,str2,80,October 21 2022,8
MockComponent,None,,,,,,,,,,b,,683902,,,,,,,,,,present,,,,,
MockComponent,None,"ab,cd","ab,cd","ab,cd","ab,cd","ab,cd","ab,cd","b,d,f","b,d,f","b,d,f",b,c,0,6.5,62.3,2,valid,https://www.google.com/,79,79,7,7,,32849,str4,55,21/10/2022,695
9 changes: 7 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,13 @@ def test_convert_nan_entries_to_empty_strings(
**load_args,
)

metadataModel = get_metadataModel(helpers, model)
get_metadataModel(helpers, model)

# Instantiate Validate manifest, and run manifest validation
# In this step the manifest is modified while running rule
# validation so need to do this step to get the updated manfest.
vm = ValidateManifest(errors, manifest, manifest_path, dmge, json_schema)
manifest, vmr_errors, vmr_warnings = vm.validate_manifest_rules(
manifest, _, _ = vm.validate_manifest_rules(
manifest,
dmge,
restrict_rules=False,
Expand All @@ -972,6 +972,11 @@ def test_convert_nan_entries_to_empty_strings(
assert output["Check List"][2] == [""]
assert output["Check List Like Enum"][2] == []

assert output["Cancer Type"][0] == "None"
assert output["Cancer Type"][1] == "None"
assert output["Cancer Type"][2] == "None"
assert output["Cancer Type"][3] == "None"

def test_get_list_robustness(self, helpers):
return

Expand Down

0 comments on commit 6eeacd5

Please sign in to comment.