示例#1
0
    def test_is_header_valid_allows_extra_columns(self):
        """Allow and ignore extra columns in the header."""

        columns = CsvImporter.REQUIRED_COLUMNS

        self.assertTrue(CsvImporter.is_header_valid(columns))
        self.assertTrue(CsvImporter.is_header_valid(columns | {'foo', 'bar'}))
示例#2
0
    def test_is_header_valid_does_not_depend_on_column_order(self):
        """Allow columns to appear in any order."""

        # sorting changes the order of the columns
        columns = sorted(CsvImporter.REQUIRED_COLUMNS)

        self.assertTrue(CsvImporter.is_header_valid(columns))