[WIP] first implementation stubs

This commit is contained in:
2024-03-22 23:11:03 +01:00
parent 33921aa992
commit 6f5c58b906
16 changed files with 637 additions and 0 deletions

30
internal/hetzner_test.go Normal file
View File

@@ -0,0 +1,30 @@
package internal
import (
"testing"
"github.com/hetznercloud/hcloud-go/hcloud"
)
func TestGetAllIps(t *testing.T) {
servers := []*hcloud.Server{{
Status: hcloud.ServerStatusRunning,
Name: "Test",
}}
servers = append(servers, &hcloud.Server{
Status: hcloud.ServerStatusRunning,
Name: "Test2",
})
expectedError := "Instance Test has no attached IP"
_, err := GetAllIps(servers)
if err == nil {
t.Error("GetAllIps did not error with missing data")
}
if err.Error() != expectedError {
t.Errorf("Wrong error message. want %s, got %s", expectedError, err.Error())
}
}