Maint: simplify provider configuration logging

This commit is contained in:
Quentin McGaw (desktop)
2021-08-19 17:41:37 +00:00
parent 5c2286f4e8
commit 6f59bc3037
23 changed files with 66 additions and 524 deletions

View File

@@ -12,48 +12,6 @@ import (
"github.com/stretchr/testify/require"
)
func Test_Provider_ivpnLines(t *testing.T) {
t.Parallel()
testCases := map[string]struct {
settings Provider
lines []string
}{
"empty settings": {
lines: []string{
"|--OpenVPN selection:",
" |--Protocol: udp",
},
},
"full settings": {
settings: Provider{
ServerSelection: ServerSelection{
Countries: []string{"A", "B"},
Cities: []string{"C", "D"},
Hostnames: []string{"E", "F"},
},
},
lines: []string{
"|--Countries: A, B",
"|--Cities: C, D",
"|--Hostnames: E, F",
"|--OpenVPN selection:",
" |--Protocol: udp",
},
},
}
for name, testCase := range testCases {
testCase := testCase
t.Run(name, func(t *testing.T) {
t.Parallel()
lines := testCase.settings.ivpnLines()
assert.Equal(t, testCase.lines, lines)
})
}
}
func Test_Provider_readIvpn(t *testing.T) {
t.Parallel()