forked from TrueCloudLab/frostfs-api-go
[#293] pkg/storagegroup: Implement and use generator of StorageGroup
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
cd32722d25
commit
318755e9de
2 changed files with 25 additions and 22 deletions
20
pkg/storagegroup/test/generate.go
Normal file
20
pkg/storagegroup/test/generate.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package storagegrouptest
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/object"
|
||||
objecttest "github.com/nspcc-dev/neofs-api-go/pkg/object/test"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/storagegroup"
|
||||
refstest "github.com/nspcc-dev/neofs-api-go/pkg/test"
|
||||
)
|
||||
|
||||
// Generate returns random storagegroup.StorageGroup.
|
||||
func Generate() *storagegroup.StorageGroup {
|
||||
x := storagegroup.New()
|
||||
|
||||
x.SetExpirationEpoch(66)
|
||||
x.SetValidationDataSize(322)
|
||||
x.SetValidationDataHash(refstest.Checksum())
|
||||
x.SetMembers([]*object.ID{objecttest.ID(), objecttest.ID()})
|
||||
|
||||
return x
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue