'Test the creation of a simple XlsxWriter file with an autofilter.
This test corresponds to the following examples/autofilter.py example:
Example 2. Autofilter with a filter condition in the first column.'

def test_create_file(self):

    workbook = Workbook(self.got_filename)
    worksheet = workbook.add_worksheet()
    worksheet.autofilter('A1:D51')
    worksheet.filter_column(0, 'region    ==    East')
    textfile = open(self.txt_filename)
    headers = textfile.readline().strip('\n').split()
    worksheet.write_row('A1', headers)
    row = 1
    for line in textfile:
        data = line.strip('\n').split()
        for (i, item) in enumerate(data):
            try:
                data[i] = float(item)
            except ValueError:
                pass
        region = data[0]
        if (region == 'East'):
            pass
        else:
            worksheet.set_row(row, options={'hidden': True})
        worksheet.write_row(row, 0, data)
        row += 1
    textfile.close()
    workbook.close()
    self.assertExcelEqual()
