tests and api fix
This commit is contained in:
parent
c36ee74c5a
commit
66aca05028
5 changed files with 118 additions and 22 deletions
30
agent/network/network_test.go
Normal file
30
agent/network/network_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package network_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/amidaware/rmmagent/agent/network"
|
||||
)
|
||||
|
||||
func TestPublicIP(t *testing.T) {
|
||||
testTable := []struct {
|
||||
name string
|
||||
expected string
|
||||
proxy string
|
||||
}{
|
||||
{
|
||||
name: "Get Public IP",
|
||||
expected: network.PublicIP(""),
|
||||
proxy: "",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range testTable {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
result := network.PublicIP(tt.proxy)
|
||||
if result != tt.expected {
|
||||
t.Errorf("expected %s, got %s", tt.expected, result)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue