2019-03-21 02:57:25 +00:00
|
|
|
package featureconfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInitFeatureConfig(t *testing.T) {
|
|
|
|
cfg := &FeatureFlagConfig{
|
2019-07-20 01:27:35 +00:00
|
|
|
NoGenesisDelay: true,
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
|
|
|
InitFeatureConfig(cfg)
|
2019-07-20 01:27:35 +00:00
|
|
|
if c := FeatureConfig(); !c.NoGenesisDelay {
|
|
|
|
t.Errorf("NoGenesisDelay in FeatureFlags incorrect. Wanted true, got false")
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestConfigureBeaconConfig(t *testing.T) {
|
|
|
|
app := cli.NewApp()
|
|
|
|
set := flag.NewFlagSet("test", 0)
|
2019-07-20 01:27:35 +00:00
|
|
|
set.Bool(NoGenesisDelayFlag.Name, true, "enable attestation verification")
|
2019-03-21 02:57:25 +00:00
|
|
|
context := cli.NewContext(app, set, nil)
|
|
|
|
ConfigureBeaconFeatures(context)
|
2019-07-20 01:27:35 +00:00
|
|
|
if c := FeatureConfig(); !c.NoGenesisDelay {
|
|
|
|
t.Errorf("NoGenesisDelay in FeatureFlags incorrect. Wanted true, got false")
|
2019-03-21 02:57:25 +00:00
|
|
|
}
|
|
|
|
}
|