prysm-pulse/shared/featureconfig/config_test.go
terence tsao 66dcf2b80d Moved /shared/ test code in different package (#3714)
* Fixed bytesutil

* Fix featureflag

* Fix hashutil

* Fix interop

* Fix iputils

* Fix mathutils

* Fix messagehandler

* Fix pagination

* Fix params

* Fix sliceutil

* Fix merkletrie
2019-10-04 15:46:49 -07:00

31 lines
862 B
Go

package featureconfig_test
import (
"flag"
"testing"
"github.com/prysmaticlabs/prysm/shared/featureconfig"
"github.com/urfave/cli"
)
func TestInitFeatureConfig(t *testing.T) {
cfg := &featureconfig.FeatureFlagConfig{
NoGenesisDelay: true,
}
featureconfig.InitFeatureConfig(cfg)
if c := featureconfig.FeatureConfig(); !c.NoGenesisDelay {
t.Errorf("NoGenesisDelay in FeatureFlags incorrect. Wanted true, got false")
}
}
func TestConfigureBeaconConfig(t *testing.T) {
app := cli.NewApp()
set := flag.NewFlagSet("test", 0)
set.Bool(featureconfig.NoGenesisDelayFlag.Name, true, "enable attestation verification")
context := cli.NewContext(app, set, nil)
featureconfig.ConfigureBeaconFeatures(context)
if c := featureconfig.FeatureConfig(); !c.NoGenesisDelay {
t.Errorf("NoGenesisDelay in FeatureFlags incorrect. Wanted true, got false")
}
}