Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and test ArgumentError for nonexistant dir #36

Merged
merged 2 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Checkpoints"
uuid = "b4a3413d-e481-5afc-88ff-bdfbd6a50dce"
authors = "Invenia Technical Computing Corporation"
version = "0.3.13"
version = "0.3.14"

[deps]
AWSS3 = "1c724243-ef5b-51ab-93f4-b0a88ac62a95"
Expand Down
2 changes: 1 addition & 1 deletion src/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ You can also work with it directly, say you wanted to get all checkpoints files
2: https://github.com/JuliaData/DataFrames.jl
"""
function index_checkpoint_files(dir::AbstractPath)
isdir(dir) || throw(ArgumentError(dir, "Need an existing directory."))
isdir(dir) || throw(ArgumentError("Need an existing directory."))
map(Iterators.filter(==("jlso") ∘ extension, walkpath(dir))) do checkpoint_path
return IndexEntry(checkpoint_path)
end
Expand Down
4 changes: 4 additions & 0 deletions test/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,8 @@
@test_throws ErrorException entry.tags
end
end

@testset "nonexistent dir" begin
@test_throws ArgumentError index_checkpoint_files("nonexistent_dir")
end
end