cwtch/storage/file_profile_store_test.go

23 lines
507 B
Go
Raw Normal View History

2018-10-06 03:50:55 +00:00
package storage
import (
"cwtch.im/cwtch/peer"
"testing"
)
func TestFileProfileStore(t *testing.T) {
fileStore := CreateFileProfileStore(".test.json", "password")
alice := peer.NewCwtchPeer("alice")
fileStore.Save(alice)
aliceLoaded, err := fileStore.Load()
if err != nil {
t.Errorf("alice profile should have been loaded from store instead %v", err)
}
if aliceLoaded.GetProfile().Name != "alice" {
t.Errorf("alice profile should have been loaded from store instead %v", aliceLoaded)
}
}