Skip to content

Commit

Permalink
testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Nov 30, 2022
1 parent 631d64e commit e2d5f56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions ignite/config/plugins/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"github.com/stretchr/testify/require"

pluginsconfig "github.com/ignite/cli/ignite/config/plugins"
"github.com/ignite/cli/ignite/config/testdata"
"github.com/ignite/cli/ignite/config/plugins/testdata"
)

func TestParse(t *testing.T) {
// Arrange: Initialize a reader with the previous version
r := bytes.NewReader(testdata.PluginsConfig)
r := bytes.NewReader(testdata.ConfigYAML)

// Act
cfg, err := pluginsconfig.Parse(r)
Expand All @@ -21,5 +21,5 @@ func TestParse(t *testing.T) {
require.NoError(t, err)

// Assert: Parse must return the latest version
require.Equal(t, testdata.GetPluginsConfig(t), cfg)
require.Equal(t, testdata.GetConfig(t), cfg)
}
9 changes: 0 additions & 9 deletions ignite/config/testdata/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ package testdata
import (
"testing"

pluginsconfig "github.com/ignite/cli/ignite/config/plugins"

"github.com/ignite/cli/ignite/config"
chainconfig "github.com/ignite/cli/ignite/config/chain"
networkconfigTestdata "github.com/ignite/cli/ignite/config/chain/network/testdata"
v0testdata "github.com/ignite/cli/ignite/config/chain/v0/testdata"
v1testdata "github.com/ignite/cli/ignite/config/chain/v1/testdata"
pluginsconfigTestdata "github.com/ignite/cli/ignite/config/plugins/testdata"
)

var Versions = map[chainconfig.Version][]byte{
Expand All @@ -20,16 +17,10 @@ var Versions = map[chainconfig.Version][]byte{

var NetworkConfig = networkconfigTestdata.ConfigYAML

var PluginsConfig = pluginsconfigTestdata.ConfigYAML

func GetLatestConfig(t *testing.T) *config.ChainConfig {
return v1testdata.GetConfig(t)
}

func GetLatestNetworkConfig(t *testing.T) *config.ChainConfig {
return networkconfigTestdata.GetConfig(t)
}

func GetPluginsConfig(t *testing.T) *pluginsconfig.Config {
return pluginsconfigTestdata.GetConfig(t)
}

0 comments on commit e2d5f56

Please sign in to comment.