Adding Open Connection Failed Test

This commit is contained in:
Sarah Jamie Lewis 2018-01-03 10:20:53 -08:00
parent 84d7336602
commit 7f215e86c4
2 changed files with 8 additions and 1 deletions

View File

@ -52,3 +52,10 @@ func TestRicochetOpenWithError(t *testing.T) {
t.Errorf("Open should have failed because of bad version negotiation.")
}
}
func TestRicochetOpenWithNoServer(t *testing.T) {
_, err := Open("127.0.0.1:11002|abcdefghijklmno.onion")
if err == nil {
t.Errorf("Open should have failed because of bad version negotiation.")
}
}

View File

@ -10,7 +10,7 @@ links it to the automated test that exercises that functionality.
File: [iricochet_test.go](./ricochet_test.go)
This stub test exercises the Open() function. `TestRicochetOpen`, `TestRicochetOpenWithError`.
This stub test exercises the Open() function. `TestRicochetOpen`, and in cases where the server returns a bad version, `TestRicochetOpenWithError`, and where there is no server at all `TestRicochetOpenWithNoServer` - in both cases Open should return an error.
## Inbound