mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
31 lines
815 B
Go
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)
|
||
|
}
|