compare_csv(test_file,
ref_file,
tolerance=DEFAULT_TOLERANCE,
lines=ALL_LINES)
|
|
Workup for comparing two CSV files.
Example use:
outcome_workup = compare_csv(test.csv, ref.csv, <0.05>, <3>)
The third argument is optional. It is a tolerance to be used for
values that can be cast as floats. Equality is required for values that
cannot be cast as floats (strings for example).
The fourth argument is optional. It is the number of lines to
compare. In the example above, the first 3 lines will be compared. If
this argument is left off, all lines are compared and the total length of
both files is required to be the same. In this case, all excess lines
will be printed to stdout as part of an error message.
The lines in each CSV file are expected to line up (i.e. line 1 in
test.csv is compared with line 1 from ref.csv). This means if a line is
skipped in test.csv all subsequent lines will cause failures (so many
failure messages will be printed - one for each line after the skip).
|