lbry.go/cmd/selfsync_test.go
Niko Storni c0be626ef2
add selfsync cmd
add tests
add more slack updates
remove unneded test
extract constants to own file
2018-07-12 08:19:05 -04:00

31 lines
757 B
Go

package cmd
import (
"fmt"
"testing"
)
func TestFetchChannels(t *testing.T) {
res, err := fetchChannels("620280")
if err != nil {
t.Error(err)
}
if res == nil {
t.Error("empty response")
}
fmt.Println(res)
}
// warning this test will actually set sync_server on the db entry for this test channel (mine)
// such field should be reset to null if the test must be run on a different machine (different hostname)
// and obviously the auth token must be appropriate
func TestSetChannelSyncStatus(t *testing.T) {
err := setChannelSyncStatus("620280", "UCNQfQvFMPnInwsU_iGYArJQ", StatusSyncing)
if err != nil {
t.Error(err)
}
err = setChannelSyncStatus("620280", "UCNQfQvFMPnInwsU_iGYArJQ", StatusQueued)
if err != nil {
t.Error(err)
}
}