MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestSaveDHT

Function TestSaveDHT

consistent/load_test.go:32–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30const testStorePath2 = "./test2.keystore"
31
32func TestSaveDHT(t *testing.T) {
33 kms.Unittest = true
34 utils.RemoveAll(testStorePath1 + "*")
35 utils.RemoveAll(testStorePath2 + "*")
36 //kms.ResetBucket()
37
38 Convey("save DHT", t, func() {
39 x, _ := InitConsistent(testStorePath1, new(KMSStorage), false)
40 x.Add(NewNodeFromString("111111"))
41 x.Add(NewNodeFromString(("3333")))
42 So(len(x.circle), ShouldEqual, x.NumberOfReplicas*2)
43 So(len(x.sortedHashes), ShouldEqual, x.NumberOfReplicas*2)
44 So(sort.IsSorted(x.sortedHashes), ShouldBeTrue)
45 kms.ClosePublicKeyStore()
46 utils.CopyFile(testStorePath1, testStorePath2)
47 })
48}
49
50func TestLoadDHT(t *testing.T) {
51 Convey("load existing DHT", t, func() {

Callers

nothing calls this directly

Calls 6

RemoveAllFunction · 0.92
ClosePublicKeyStoreFunction · 0.92
CopyFileFunction · 0.92
InitConsistentFunction · 0.85
NewNodeFromStringFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected