-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #892 from subutai-io/dev
Dev
- Loading branch information
Showing
9 changed files
with
410 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestValidateDHT(t *testing.T) { | ||
if validateDHT("") != errEmptyDHTEndpoint { | ||
t.Fatalf("DHT Validate: providing empty list doesn't generate proper error") | ||
} | ||
if validateDHT("google.com") != errBadDHTEndpoint { | ||
t.Fatalf("Providing URL without port doesn't generate expected error") | ||
} | ||
if validateDHT("iamnotexist.atall:80") != errBadDHTEndpoint { | ||
t.Fatalf("Providing non existing URL doesn't generate expected error") | ||
} | ||
if validateDHT("google.com:80") != nil { | ||
t.Fatalf("Providing correct endpoint generates error") | ||
} | ||
if validateDHT("google.com:80,yandex.ru:80") != nil { | ||
t.Fatalf("Providing correct endpoints generates error") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.