Skip to content

Commit

Permalink
modified online test so it wouldn't stuck in prompt
Browse files Browse the repository at this point in the history
SSHCredentials is a subtype of AbstractCredentials
  • Loading branch information
wildart committed May 14, 2016
1 parent 8733e14 commit 3fe69f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base/libgit2/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ end
reset!(p::UserPasswordCredentials, cnt::Int=3) = (p.count = cnt)

"SSH credentials type"
type SSHCredentials
type SSHCredentials <: AbstractCredentials
user::AbstractString
pass::AbstractString
pubkey::AbstractString
Expand Down
9 changes: 7 additions & 2 deletions test/libgit2-online.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ mktempdir() do dir
finalize(repo)
end
#end
try
#@testset "with incorrect url" begin
repo_path = joinpath(dir, "Example2")
# credential are required because github try authenticate on uknown repo
x = Nullable(LibGit2.UserPasswordCredentials("X","X"))
@test_throws LibGit2.Error.GitError LibGit2.clone(https_prefix*repo_url*randstring(10), repo_path, payload=x)
cred = LibGit2.UserPasswordCredentials("","") # empty credentials cause authentication error
LibGit2.clone(https_prefix*repo_url*randstring(10), repo_path, payload=Nullable(cred))
#end
catch ex
@test isa(ex, LibGit2.Error.GitError)
@test ex.code == LibGit2.Error.EAUTH
end

try
#@testset "with 'ssh' protocol (by default is not supported)" begin
Expand Down

0 comments on commit 3fe69f5

Please sign in to comment.