Skip to content

Commit

Permalink
Merge pull request #121 from 4dn-dcic/fffe_fix
Browse files Browse the repository at this point in the history
Fffe fix
  • Loading branch information
aschroed committed Oct 30, 2018
2 parents f7a808d + 90ee7fe commit d82071c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 32 deletions.
39 changes: 8 additions & 31 deletions tests/test_import_data.py
Expand Up @@ -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',
Expand Down Expand Up @@ -961,37 +969,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 {
Expand Down
2 changes: 1 addition & 1 deletion wranglertools/import_data.py
Expand Up @@ -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]
Expand Down

0 comments on commit d82071c

Please sign in to comment.