feature/tt/initial-implementation (#1)
Some checks failed
Gitea Docker Build Demo / Test (push) Successful in 2m24s
Gitea Docker Build Demo / Build_Image (push) Failing after 1m40s
Release / Test (release) Successful in 2m22s
Release / Build_Image (release) Failing after 44s

Reviewed-on: #1
Co-authored-by: Tobias Trabelsi <lerentis@uploadfilter24.eu>
Co-committed-by: Tobias Trabelsi <lerentis@uploadfilter24.eu>
This commit is contained in:
2025-10-06 09:21:57 +00:00
committed by lerentis
parent 33921aa992
commit e51594fdd7
17 changed files with 774 additions and 1 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 public Addresses"
_, 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())
}
}