Skip to content

Commit

Permalink
Added back is_match tests for CSVData (capitalone#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
gautomdas authored Jul 21, 2021
1 parent 39e5f08 commit 1ca7f7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 8 additions & 0 deletions dataprofiler/tests/data_readers/test_csv_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ def setUp(cls):
for buffer in cls.buffer_list:
buffer['path'].seek(0)

def test_is_match(self):
"""
Determine if the csv file can be automatically identified from
byte stream or stringio stream or file path
"""
for input_file in self.file_or_buf_list:
self.assertTrue(CSVData.is_match(input_file['path']))

def test_auto_file_identification(self):
"""
Determine if the csv file can be automatically identified
Expand Down
10 changes: 4 additions & 6 deletions dataprofiler/tests/data_readers/test_parquet_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ def setUp(cls):
for buffer in cls.buffer_list:
buffer['path'].seek(0)

def test_is_match_for_byte_streams(self):
def test_is_match(self):
"""
Determine if the parquet file can be automatically identified from
byte stream
byte stream or file path
"""
for input_file in self.input_file_names:
with open(input_file['path'], 'rb') as fp:
byte_string = BytesIO(fp.read())
self.assertTrue(ParquetData.is_match(byte_string))
for input_file in self.file_or_buf_list:
self.assertTrue(ParquetData.is_match(input_file['path']))

def test_auto_file_identification(self):
"""
Expand Down

0 comments on commit 1ca7f7b

Please sign in to comment.