aboutsummaryrefslogtreecommitdiffstats
path: root/clients/ssh/auth_method_test.go
diff options
context:
space:
mode:
authorAlberto Cortés <alberto@sourced.tech>2015-11-17 15:51:40 +0100
committerAlberto Cortés <alberto@sourced.tech>2015-11-17 16:16:44 +0100
commit0bb17cd1b83753aff4de1aa6a3f5ffd280991694 (patch)
tree432823afbe8bf5633dd4af5911b586b5f2ea4e9f /clients/ssh/auth_method_test.go
parent49f40d9f410a6fc0a9c89ba228d16cd570ec711a (diff)
downloadgo-git-0bb17cd1b83753aff4de1aa6a3f5ffd280991694.tar.gz
ssh client
Diffstat (limited to 'clients/ssh/auth_method_test.go')
-rw-r--r--clients/ssh/auth_method_test.go94
1 files changed, 94 insertions, 0 deletions
diff --git a/clients/ssh/auth_method_test.go b/clients/ssh/auth_method_test.go
new file mode 100644
index 0000000..ca4558d
--- /dev/null
+++ b/clients/ssh/auth_method_test.go
@@ -0,0 +1,94 @@
+package ssh
+
+import (
+ "fmt"
+ "testing"
+
+ . "gopkg.in/check.v1"
+)
+
+func Test(t *testing.T) { TestingT(t) }
+
+type SuiteCommon struct{}
+
+var _ = Suite(&SuiteCommon{})
+
+func (s *SuiteRemote) TestKeyboardInteractiveName(c *C) {
+ a := &KeyboardInteractive{
+ User: "test",
+ Challenge: nil,
+ }
+ c.Assert(a.Name(), Equals, KeyboardInteractiveName)
+}
+
+func (s *SuiteRemote) TestKeyboardInteractiveString(c *C) {
+ a := &KeyboardInteractive{
+ User: "test",
+ Challenge: nil,
+ }
+ c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", KeyboardInteractiveName))
+}
+
+func (s *SuiteRemote) TestPasswordName(c *C) {
+ a := &Password{
+ User: "test",
+ Pass: "",
+ }
+ c.Assert(a.Name(), Equals, PasswordName)
+}
+
+func (s *SuiteRemote) TestPasswordString(c *C) {
+ a := &Password{
+ User: "test",
+ Pass: "",
+ }
+ c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordName))
+}
+
+func (s *SuiteRemote) TestPasswordCallbackName(c *C) {
+ a := &PasswordCallback{
+ User: "test",
+ Callback: nil,
+ }
+ c.Assert(a.Name(), Equals, PasswordCallbackName)
+}
+
+func (s *SuiteRemote) TestPasswordCallbackString(c *C) {
+ a := &PasswordCallback{
+ User: "test",
+ Callback: nil,
+ }
+ c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PasswordCallbackName))
+}
+
+func (s *SuiteRemote) TestPublicKeysName(c *C) {
+ a := &PublicKeys{
+ User: "test",
+ Signer: nil,
+ }
+ c.Assert(a.Name(), Equals, PublicKeysName)
+}
+
+func (s *SuiteRemote) TestPublicKeysString(c *C) {
+ a := &PublicKeys{
+ User: "test",
+ Signer: nil,
+ }
+ c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PublicKeysName))
+}
+
+func (s *SuiteRemote) TestPublicKeysCallbackName(c *C) {
+ a := &PublicKeysCallback{
+ User: "test",
+ Callback: nil,
+ }
+ c.Assert(a.Name(), Equals, PublicKeysCallbackName)
+}
+
+func (s *SuiteRemote) TestPublicKeysCallbackString(c *C) {
+ a := &PublicKeysCallback{
+ User: "test",
+ Callback: nil,
+ }
+ c.Assert(a.String(), Equals, fmt.Sprintf("user: test, name: %s", PublicKeysCallbackName))
+}