mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-27 12:56:24 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/models"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -20,18 +21,18 @@ func Test_AllServers_MarshalJSON(t *testing.T) {
|
||||
}{
|
||||
"no provider": {
|
||||
allServers: &AllServers{
|
||||
ProviderToServers: map[string]Servers{},
|
||||
ProviderToServers: map[string]models.Servers{},
|
||||
},
|
||||
dataString: `{"version":0}`,
|
||||
},
|
||||
"two providers": {
|
||||
allServers: &AllServers{
|
||||
Version: 1,
|
||||
ProviderToServers: map[string]Servers{
|
||||
ProviderToServers: map[string]models.Servers{
|
||||
providers.Cyberghost: {
|
||||
Version: 1,
|
||||
Timestamp: 1000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{Country: "A"},
|
||||
{Country: "B"},
|
||||
},
|
||||
@@ -39,7 +40,7 @@ func Test_AllServers_MarshalJSON(t *testing.T) {
|
||||
providers.Privado: {
|
||||
Version: 2,
|
||||
Timestamp: 2000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{City: "C"},
|
||||
{City: "D"},
|
||||
},
|
||||
@@ -100,11 +101,11 @@ func Test_AllServers_UnmarshalJSON(t *testing.T) {
|
||||
`"privado":{"version":2,"timestamp":2000,"servers":[{"city":"C"},{"city":"D"}]}}`,
|
||||
allServers: AllServers{
|
||||
Version: 1,
|
||||
ProviderToServers: map[string]Servers{
|
||||
ProviderToServers: map[string]models.Servers{
|
||||
providers.Cyberghost: {
|
||||
Version: 1,
|
||||
Timestamp: 1000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{Country: "A"},
|
||||
{Country: "B"},
|
||||
},
|
||||
@@ -112,7 +113,7 @@ func Test_AllServers_UnmarshalJSON(t *testing.T) {
|
||||
providers.Privado: {
|
||||
Version: 2,
|
||||
Timestamp: 2000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{City: "C"},
|
||||
{City: "D"},
|
||||
},
|
||||
@@ -146,11 +147,11 @@ func Test_AllServers_JSON_Marshal_Unmarshal(t *testing.T) {
|
||||
|
||||
allServers := &AllServers{
|
||||
Version: 1,
|
||||
ProviderToServers: map[string]Servers{
|
||||
ProviderToServers: map[string]models.Servers{
|
||||
providers.Cyberghost: {
|
||||
Version: 1,
|
||||
Timestamp: 1000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{Country: "A"},
|
||||
{Country: "B"},
|
||||
},
|
||||
@@ -158,7 +159,7 @@ func Test_AllServers_JSON_Marshal_Unmarshal(t *testing.T) {
|
||||
providers.Privado: {
|
||||
Version: 2,
|
||||
Timestamp: 2000,
|
||||
Servers: []Server{
|
||||
Servers: []models.Server{
|
||||
{City: "C"},
|
||||
{City: "D"},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user