Skip to content

Commit 9825764

Browse files
authored
Merge pull request #138 from lisad/test_another_col_name_case
Adds a test to make sure that files with returns in column names get fixed
2 parents 7635a72 + 54f2770 commit 9825764

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/test_columns.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ def test_conflicting_renames():
128128
Phase(columns=[FloatColumn(name="Division", rename='div'), IntColumn(name="Divisor", rename='div')])
129129

130130

131-
def test_canonicalize_names():
131+
@pytest.mark.parametrize('column_name', ['country of origin', 'country_of_origin', 'Country of\nOrigin'])
132+
def test_canonicalize_names(column_name):
132133
col1 = Column("Country of Origin")
133134
phase = Phase(columns=[col1])
134-
phase.load_data([{'country of origin': 'UK'}, {'country_of_origin': 'US'}])
135+
phase.load_data([{column_name: 'UK'}, {column_name: 'US'}])
135136
phase.rename_columns()
136137
assert all(list(row.keys()) == ['Country of Origin'] for row in phase.row_data)
137138
assert phase.headers == ['Country of Origin']

0 commit comments

Comments
 (0)