aboutsummaryrefslogtreecommitdiff
path: root/web/fly/flydns/flydns_test.go
blob: 17576efcecc1a7b37ce52538dd1571dc490c411d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package flydns

import (
	"os"
	"testing"
)

func TestGetApps(t *testing.T) {
	if os.Getenv("DO_FLY") == "" {
		t.Skip()
	}

	// Call the function to be tested
	result, err := GetApps()

	t.Logf("%v", result)

	// Check for the error
	if err != nil {
		t.Errorf("Expected no error, but got an error: %v", err)
	}
}

func TestParseMachine(t *testing.T) {
	input := "1781965b593689 yyz"
	expected := Machine{"1781965b593689", "yyz"}

	result, err := parseMachine(input)
	if err != nil {
		t.Errorf("Expected no error, but got an error: %v", err)
	}

	if result != expected {
		t.Errorf("Expected %v, but got %v", expected, result)
	}
}