Official cwtch.im peer and server implementations. https://cwtch.im
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
497B

  1. package storage
  2. import (
  3. "cwtch.im/cwtch/peer"
  4. "testing"
  5. )
  6. func TestFileProfileStore(t *testing.T) {
  7. fileStore := NewFileStore(".test.json", "password")
  8. alice := peer.NewCwtchPeer("alice")
  9. fileStore.Save(alice)
  10. aliceLoaded, err := fileStore.Load()
  11. if err != nil {
  12. t.Errorf("alice profile should have been loaded from store instead %v", err)
  13. }
  14. if aliceLoaded.GetProfile().Name != "alice" {
  15. t.Errorf("alice profile should have been loaded from store instead %v", aliceLoaded)
  16. }
  17. }