Skip to content

Commit

Permalink
tests/datasources: ignore extra columns for tsv switch inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
owendelong authored and sarcasticadmin committed Feb 6, 2025
1 parent b1f5121 commit 6313cbf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions facts/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@ def test_datafile(delimiter, meta):
continue
# run the validators for each column
for i, val in enumerate(elems):
# If we don't have tests for extra columns, ignore them.
if i >= len(meta["cols"]):
continue
print("Processing index ", i, ' with value "', val, '"\n')
if not meta["cols"][i](val.rstrip("\n")):
print("Test failed at", i, "Because not newline?\n")
return False, "invalid field " + val + " failed " + meta["cols"][
i
].__name__ + " at line " + str(linenum + 1) + " of " + meta["file"]
Expand Down

0 comments on commit 6313cbf

Please sign in to comment.