Skip to content

Commit

Permalink
Added new test to achieve full coverage (#157)
Browse files Browse the repository at this point in the history
* Added new test to achieve full coverage

* Rewrote test to be compatible with Julia 1.6
  • Loading branch information
clizbe committed Oct 18, 2023
1 parent 41233c8 commit 92ea7e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ end
df = CSV.read(joinpath(dir, "bad-assets-data.csv"), DataFrame; header = 2)

# FIXME: instead of examples, mutate and test
# Example 1 - bad data, silent
col_err, col_type_err = TulipaEnergyModel.validate_df(
df,
TulipaEnergyModel.AssetData;
Expand All @@ -60,5 +61,12 @@ end
@test col_err == [:id]
@test col_type_err ==
[(:investable, Bool, String7), (:peak_demand, Float64, String7)]

# Example 2 - bad data, verbose
@test_throws ErrorException TulipaEnergyModel.validate_df(
df,
TulipaEnergyModel.AssetData;
fname = "bad-assets-data.csv",
)
end
end

0 comments on commit 92ea7e4

Please sign in to comment.