mirror of
https://github.com/lxc/distrobuilder.git
synced 2026-02-05 06:45:19 +01:00
sources: Update the tests for HTTP client
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
@@ -2,6 +2,7 @@ package sources
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
|
||||
func TestApertisHTTP_getLatestRelease(t *testing.T) {
|
||||
s := &apertis{}
|
||||
s.client = http.DefaultClient
|
||||
|
||||
tests := []struct {
|
||||
release string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package sources
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
@@ -8,7 +9,8 @@ import (
|
||||
)
|
||||
|
||||
func TestArchLinuxGetLatestRelease(t *testing.T) {
|
||||
var src archlinux
|
||||
src := &archlinux{}
|
||||
src.client = http.DefaultClient
|
||||
|
||||
release, err := src.getLatestRelease("https://archive.archlinux.org/iso/", "x86_64")
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package sources
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -8,6 +9,7 @@ import (
|
||||
|
||||
func TestGetLatestRelease(t *testing.T) {
|
||||
s := &openEuler{}
|
||||
s.client = http.DefaultClient
|
||||
|
||||
tests := []struct {
|
||||
url string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package sources
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"regexp"
|
||||
"testing"
|
||||
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
|
||||
func TestOpenWrtHTTP_getLatestServiceRelease(t *testing.T) {
|
||||
s := &openwrt{}
|
||||
s.client = http.DefaultClient
|
||||
|
||||
tests := []struct {
|
||||
release string
|
||||
|
||||
Reference in New Issue
Block a user