mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-27 05:38:55 +00:00
a9a4bb9163
* move testutil * util pkg * build * gaz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
44 lines
871 B
Go
44 lines
871 B
Go
package cmd
|
|
|
|
import (
|
|
"flag"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/config/params"
|
|
"github.com/prysmaticlabs/prysm/testing/assert"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
func TestOverrideConfig(t *testing.T) {
|
|
cfg := &Flags{
|
|
MinimalConfig: true,
|
|
}
|
|
reset := InitWithReset(cfg)
|
|
defer reset()
|
|
c := Get()
|
|
assert.Equal(t, true, c.MinimalConfig)
|
|
}
|
|
|
|
func TestDefaultConfig(t *testing.T) {
|
|
cfg := &Flags{
|
|
MaxRPCPageSize: params.BeaconConfig().DefaultPageSize,
|
|
}
|
|
c := Get()
|
|
assert.DeepEqual(t, c, cfg)
|
|
|
|
reset := InitWithReset(cfg)
|
|
defer reset()
|
|
c = Get()
|
|
assert.DeepEqual(t, c, cfg)
|
|
}
|
|
|
|
func TestConfigureBeaconConfig(t *testing.T) {
|
|
app := cli.App{}
|
|
set := flag.NewFlagSet("test", 0)
|
|
set.Bool(MinimalConfigFlag.Name, true, "test")
|
|
context := cli.NewContext(&app, set, nil)
|
|
ConfigureBeaconChain(context)
|
|
c := Get()
|
|
assert.Equal(t, true, c.MinimalConfig)
|
|
}
|