From 4e27df57a3e1261dedd8ff06ac9ce4bf45919573 Mon Sep 17 00:00:00 2001 From: Sarah Date: Tue, 30 Oct 2018 13:12:21 -0400 Subject: [PATCH 1/3] removed fffe reference from test_import_data.py --- tests/test_import_data.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/tests/test_import_data.py b/tests/test_import_data.py index f81b4da0..baf0f2ff 100644 --- a/tests/test_import_data.py +++ b/tests/test_import_data.py @@ -961,37 +961,6 @@ def test_file_pair_chk_sheets_w_no_aliases_col_skipped(): assert report['NO GO'] == 'Can only check file pairing by aliases' -@pytest.fixture -def profile_fffe(): - '''fixture to test the file_format_file_extention schema info''' - return { - "file_format_file_extension": { - "bam": ".bam", - "bai": ".bam.bai", - "pairs": ".pairs.gz", - "pairsam": ".sam.pairs.gz", - "pairs_px2": ".pairs.gz.px2", - "pairsam_px2": ".sam.pairs.gz.px2", - "cool": ".cool", - "mcool": ".mcool", - "hic": ".hic", - "normvector_juicerformat": ".normvector.juicerformat.gz", - "zip": ".zip", - "bg": ".bedGraph.gz", - "bg_px2": ".bedGraph.gz.px2", - "bw": ".bw", - "bed": ".bed.gz", - "txt": ".txt.gz", - "csv": ".csv", - "other": "", - "barcode_file": ".txt", - "compressed_fasta": ".fasta.gz", - "fasta": ".fasta", - "juicer_format_restriction_site_file": ".txt" - } - } - - @pytest.fixture def mock_profiles(): return { From 0c43b8b0786b5803822e170d59cc2061187426ab Mon Sep 17 00:00:00 2001 From: Sarah Date: Tue, 30 Oct 2018 13:14:57 -0400 Subject: [PATCH 2/3] changed regex to work for more atids - now covers item types with hyphens --- wranglertools/import_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wranglertools/import_data.py b/wranglertools/import_data.py index 65686b00..1c156cf7 100755 --- a/wranglertools/import_data.py +++ b/wranglertools/import_data.py @@ -416,7 +416,7 @@ def add_to_mistype_message(item='', itype='', ftype='', msg=''): def validate_item(itemlist, typeinfield, alias_dict, connection): msg = '' - pattern = re.compile(r"/(\w+)/\w") + pattern = re.compile(r"/[\w-]+/\w") for item in itemlist: if item in alias_dict: itemtype = alias_dict[item] From 90ee7fe0f3911bd9ff5f5ff58f9555d82afa8112 Mon Sep 17 00:00:00 2001 From: Sarah Date: Tue, 30 Oct 2018 13:40:30 -0400 Subject: [PATCH 3/3] Added test that ensures '/ontology-terms/' @id prefix is recognized --- tests/test_import_data.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_import_data.py b/tests/test_import_data.py index baf0f2ff..dd0ad7de 100644 --- a/tests/test_import_data.py +++ b/tests/test_import_data.py @@ -791,6 +791,14 @@ def test_validate_item_not_in_alias_dict_alias_indb_long_name(mocker, connection assert not msg +def test_validate_item_not_in_alias_dict_hyphen(mocker, connection_mock): + item = '/ontology-terms/EFO%3A0006274' + with mocker.patch('dcicutils.ff_utils.get_metadata', + return_value={'@type': ['OntologyTerm']}): + msg = imp.validate_item([item], 'Individual', {}, connection_mock) + assert " \'/ontology-terms/EFO%3A0006274\'" in msg + + def test_validate_item_not_in_alias_dict_alias_not_indb(mocker, connection_mock): item = 'test:alias1' with mocker.patch('dcicutils.ff_utils.get_metadata',