Files
gluetun/internal/models/markdown_test.go
Quentin McGaw (desktop) f9aadeef1c Maint: Remove CYBERGHOST_GROUP (change)
- It does not make any sense with newer server data
- It was to be deprecated anyway
2021-09-23 13:54:24 +00:00

46 lines
1007 B
Go

package models
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_CyberghostServers_ToMarkdown(t *testing.T) {
t.Parallel()
servers := CyberghostServers{
Servers: []CyberghostServer{
{Country: "a", UDP: true, Hostname: "xa"},
{Country: "b", TCP: true, Hostname: "xb"},
},
}
markdown := servers.ToMarkdown()
const expected = "| Country | Hostname | TCP | UDP |\n" +
"| --- | --- | --- | --- |\n" +
"| a | `xa` | ❎ | ✅ |\n" +
"| b | `xb` | ✅ | ❎ |\n"
assert.Equal(t, expected, markdown)
}
func Test_FastestvpnServers_ToMarkdown(t *testing.T) {
t.Parallel()
servers := FastestvpnServers{
Servers: []FastestvpnServer{
{Country: "a", Hostname: "xa", TCP: true},
{Country: "b", Hostname: "xb", UDP: true},
},
}
markdown := servers.ToMarkdown()
const expected = "| Country | Hostname | TCP | UDP |\n" +
"| --- | --- | --- | --- |\n" +
"| a | `xa` | ✅ | ❎ |\n" +
"| b | `xb` | ❎ | ✅ |\n"
assert.Equal(t, expected, markdown)
}