add tests
This commit is contained in:
parent
efd6a4b620
commit
7754abf1d0
2 changed files with 35 additions and 0 deletions
9
cmd/ytsync_test.go
Normal file
9
cmd/ytsync_test.go
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFetchChannels(t *testing.T) {
|
||||||
|
fetchChannels()
|
||||||
|
}
|
26
ytsync/ytsync_test.go
Normal file
26
ytsync/ytsync_test.go
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
package ytsync
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestWaitForDaemonProcess(t *testing.T) {
|
||||||
|
/*
|
||||||
|
err := startDaemonViaSystemd()
|
||||||
|
if err != nil {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
log.Infoln("Waiting 5 seconds for the daemon to start...")
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
|
err = stopDaemonViaSystemd()
|
||||||
|
if err != nil {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
//start lbrynet before running this test
|
||||||
|
// stop lbrynet while running this test
|
||||||
|
err := waitForDaemonProcess(100)
|
||||||
|
if err != nil {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue