1
0
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:
Stéphane Graber
2025-11-29 23:14:46 -05:00
parent 27e9ba9b4e
commit deed503946
4 changed files with 9 additions and 1 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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