2022-09-06 09:30:45 +02:00
|
|
|
package client
|
2022-01-15 22:19:29 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"testing"
|
2022-09-02 12:07:21 +02:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2022-01-15 22:19:29 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCreate(t *testing.T) {
|
|
|
|
id := CreateIdentity("myname")
|
|
|
|
id.Save("test.id")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestLoad(t *testing.T) {
|
|
|
|
id, err := LoadIdentity("test.id")
|
|
|
|
if err != nil {
|
2022-09-02 12:07:21 +02:00
|
|
|
log.Println(err.Error())
|
2022-01-15 22:19:29 +01:00
|
|
|
}
|
2022-09-02 12:07:21 +02:00
|
|
|
assert.Equal(t, id.Nickname, "myname", "The two words should be the same.")
|
2022-01-15 22:19:29 +01:00
|
|
|
}
|