mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
25 lines
455 B
Go
25 lines
455 B
Go
|
package communicator
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/hashicorp/terraform/terraform"
|
||
|
)
|
||
|
|
||
|
func TestCommunicator_new(t *testing.T) {
|
||
|
r := &terraform.InstanceState{
|
||
|
Ephemeral: terraform.EphemeralState{
|
||
|
ConnInfo: map[string]string{
|
||
|
"type": "telnet",
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
if _, err := New(r); err == nil {
|
||
|
t.Fatalf("expected error with telnet")
|
||
|
}
|
||
|
r.Ephemeral.ConnInfo["type"] = "ssh"
|
||
|
if _, err := New(r); err != nil {
|
||
|
t.Fatalf("err: %v", err)
|
||
|
}
|
||
|
}
|