prysm-pulse/cmd/beacon-chain/storage/options_test.go
Nishant Das 0498e0a4d5
Fix Blob Storage Path (#13222)
* fix the path

* gaz
2023-11-25 01:57:22 +00:00

31 lines
815 B
Go

package storage
import (
"flag"
"testing"
"github.com/prysmaticlabs/prysm/v4/cmd"
"github.com/prysmaticlabs/prysm/v4/testing/assert"
"github.com/urfave/cli/v2"
)
func TestBlobStoragePath_NoFlagSpecified(t *testing.T) {
app := cli.App{}
set := flag.NewFlagSet("test", 0)
set.String(cmd.DataDirFlag.Name, cmd.DataDirFlag.Value, cmd.DataDirFlag.Usage)
cliCtx := cli.NewContext(&app, set, nil)
storagePath := blobStoragePath(cliCtx)
assert.Equal(t, cmd.DefaultDataDir()+"/blobs", storagePath)
}
func TestBlobStoragePath_FlagSpecified(t *testing.T) {
app := cli.App{}
set := flag.NewFlagSet("test", 0)
set.String(BlobStoragePath.Name, "/blah/blah", BlobStoragePath.Usage)
cliCtx := cli.NewContext(&app, set, nil)
storagePath := blobStoragePath(cliCtx)
assert.Equal(t, "/blah/blah", storagePath)
}