Skip to content

Commit

Permalink
add gzip mime
Browse files Browse the repository at this point in the history
  • Loading branch information
j2salmingo committed Nov 12, 2024
1 parent e1ea633 commit a5a4257
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pipeval/validate/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _identify_compression(path:Path):
''' Identify compression type and returns appropriate file handler '''
compression_handlers = {
'application/x-gzip': gzip.open,
# 'application/gzip': gzip.open,
'application/gzip': gzip.open,
'application/x-bzip2': bz2.open
}

Expand Down
2 changes: 1 addition & 1 deletion pipeval/validate/validators/fastq.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _get_file_handler(self):
'''Detect file format and return approriate handler to read file'''
_handler_map = {
'application/x-gzip': gzip.open,
# 'application/gzip': gzip.open,
'application/gzip': gzip.open,
'application/x-bzip2': bz2.open,
'text/plain': open
}
Expand Down
4 changes: 3 additions & 1 deletion test/unit/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def test__check_compressed__raises_warning_for_uncompressed_path(mock_path, mock
'compression_mime',
[
('application/x-gzip'),
('application/gzip'),
('application/x-bzip2')
]
)
Expand Down Expand Up @@ -491,7 +492,7 @@ def test__validate_record__passes_valid_read():
'test_file_type, test_handler',
[
('application/x-gzip', gzip.open),
# ('application/gzip', gzip.open),
('application/gzip', gzip.open),
('application/x-bzip2', bz2.open),
('text/plain', open)
]
Expand Down Expand Up @@ -581,6 +582,7 @@ def test__validate_fastq__passes_valid_fastq(
'test_file_type, test_handler',
[
('application/x-gzip', gzip.open),
('application/gzip', gzip.open),
('application/x-bzip2', bz2.open),
('any/other', None)
]
Expand Down

0 comments on commit a5a4257

Please sign in to comment.