2018-03-11 18:49:10 +00:00
|
|
|
package peer
|
2018-03-09 20:44:13 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCwtchPeerGenerate(t *testing.T) {
|
2018-03-14 22:03:53 +00:00
|
|
|
|
|
|
|
alice := NewCwtchPeer("alice")
|
|
|
|
alice.Save("./test_profile")
|
|
|
|
|
|
|
|
aliceLoaded, err := LoadCwtchPeer("./test_profile")
|
|
|
|
if err != nil || aliceLoaded.Profile.Name != "alice" {
|
|
|
|
t.Errorf("something went wrong saving and loading profiles %v %v", err, aliceLoaded)
|
2018-03-09 20:44:13 +00:00
|
|
|
}
|
2018-03-14 22:03:53 +00:00
|
|
|
|
2018-03-09 20:44:13 +00:00
|
|
|
}
|