Skip to content

Commit

Permalink
switch order config test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Mar 28, 2024
1 parent 09b7821 commit 2b13f13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ global-labels = [["chain-id", "ojo-local-testnet"]]
require.Equal(t, provider.ProviderBinance, cfg.CurrencyPairs[0].Providers[1])
}

func TestCheckProviderMins_Valid(t *testing.T) {
func TestCheckProviderMins_Invalid(t *testing.T) {
tmpFile, err := ioutil.TempFile("", "price-feeder*.toml")
require.NoError(t, err)
defer os.Remove(tmpFile.Name())
Expand All @@ -647,7 +647,6 @@ quote = "USDT"
providers = [
"kraken",
"binance",
"huobi"
]
[[currency_pairs]]
Expand Down Expand Up @@ -694,10 +693,10 @@ enabled = false

logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.InfoLevel).With().Timestamp().Logger()
err = config.CheckProviderMins(context.TODO(), logger, cfg)
require.NoError(t, err)
require.EqualError(t, err, "must have at least 3 providers for ATOM")
}

func TestCheckProviderMins_Invalid(t *testing.T) {
func TestCheckProviderMins_Valid(t *testing.T) {
tmpFile, err := ioutil.TempFile("", "price-feeder*.toml")
require.NoError(t, err)
defer os.Remove(tmpFile.Name())
Expand All @@ -717,6 +716,7 @@ quote = "USDT"
providers = [
"kraken",
"binance",
"huobi"
]
[[currency_pairs]]
Expand Down Expand Up @@ -763,7 +763,7 @@ enabled = false

logger := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.InfoLevel).With().Timestamp().Logger()
err = config.CheckProviderMins(context.TODO(), logger, cfg)
require.EqualError(t, err, "must have at least 3 providers for ATOM")
require.NoError(t, err)
}

func TestProviderWithAPIKey_Valid(t *testing.T) {
Expand Down

0 comments on commit 2b13f13

Please sign in to comment.