mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
c47d18aa0b
* Featureflag: properly init test * Merge refs/heads/master into fix-feature-test
33 lines
664 B
Go
33 lines
664 B
Go
package featureconfig
|
|
|
|
import (
|
|
"flag"
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
func TestInitFeatureConfig(t *testing.T) {
|
|
cfg := &Flags{
|
|
SkipBLSVerify: true,
|
|
}
|
|
Init(cfg)
|
|
c := Get()
|
|
assert.Equal(t, true, c.SkipBLSVerify)
|
|
|
|
// Reset back to false for the follow up tests.
|
|
cfg = &Flags{SkipBLSVerify: false}
|
|
Init(cfg)
|
|
}
|
|
|
|
func TestConfigureBeaconConfig(t *testing.T) {
|
|
app := cli.App{}
|
|
set := flag.NewFlagSet("test", 0)
|
|
set.Bool(skipBLSVerifyFlag.Name, true, "test")
|
|
context := cli.NewContext(&app, set, nil)
|
|
ConfigureBeaconChain(context)
|
|
c := Get()
|
|
assert.Equal(t, true, c.SkipBLSVerify)
|
|
}
|