'Test the dump function by outputting to a csv file.
Given the parquet_file and csv_file representation, converts the parquet_file to a csv
using the dump utility and then compares the result to the csv_file.'

def _test_file_csv(self, parquet_file, csv_file):

    expected_data = []
    with io.open(csv_file, u'r', encoding=u'utf-8') as f:
        expected_data = list(csv.reader(f, delimiter=PIPE_DELIM))
    actual_raw_data = io.StringIO()
    parquet.dump(parquet_file, Options(), out=actual_raw_data)
    actual_raw_data.seek(0, 0)
    actual_data = list(csv.reader(actual_raw_data, delimiter=TAB_DELIM))
    self.tc.assertListEqual(expected_data, actual_data)
    actual_raw_data = io.StringIO()
    parquet.dump(parquet_file, Options(no_headers=False), out=actual_raw_data)
    actual_raw_data.seek(0, 0)
    actual_data = list(csv.reader(actual_raw_data, delimiter=TAB_DELIM))[1:]
    self.tc.assertListEqual(expected_data, actual_data)
