Files
gluetun/internal/provider/slickvpn/updater/helpers_test.go
Richard Hodgson d0dfc21e2b feat: SlickVPN Support (#961)
- `internal/updater/html` package
- Add unit tests for slickvpn updating code
- Change shared html package to be more share-able
- Split html utilities in multiple files
- Fix processing .ovpn files with prefix space

Authored by @Rohaq 
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
2022-08-15 08:25:06 -07:00

27 lines
488 B
Go

package updater
import (
"os"
"strings"
"testing"
"github.com/stretchr/testify/require"
"golang.org/x/net/html"
)
func parseTestHTML(t *testing.T, htmlString string) *html.Node {
t.Helper()
rootNode, err := html.Parse(strings.NewReader(htmlString))
require.NoError(t, err)
return rootNode
}
func parseTestDataIndexHTML(t *testing.T) *html.Node {
t.Helper()
data, err := os.ReadFile("testdata/index.html")
require.NoError(t, err)
return parseTestHTML(t, string(data))
}