2018-05-27 22:40:42 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCommenterSessionUpdateBasics(t *testing.T) {
|
|
|
|
failTestOnError(t, setupTestEnv())
|
|
|
|
|
2018-06-20 11:29:55 +08:00
|
|
|
commenterToken, _ := commenterTokenNew()
|
2018-05-27 22:40:42 +08:00
|
|
|
|
2018-06-20 11:29:55 +08:00
|
|
|
if err := commenterSessionUpdate(commenterToken, "temp-commenter-hex"); err != nil {
|
|
|
|
t.Errorf("unexpected error updating commenter session: %v", err)
|
2018-05-27 22:40:42 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestCommenterSessionUpdateEmpty(t *testing.T) {
|
|
|
|
failTestOnError(t, setupTestEnv())
|
|
|
|
|
|
|
|
if err := commenterSessionUpdate("", "temp-commenter-hex"); err == nil {
|
2018-06-20 11:29:55 +08:00
|
|
|
t.Errorf("expected error not found when updating with empty commenterToken")
|
2018-05-27 22:40:42 +08:00
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|