From 7754abf1d0f7ba0b4b73525a4eb7aeeae1afae0a Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 25 Apr 2018 17:05:26 -0400 Subject: [PATCH] add tests --- cmd/ytsync_test.go | 9 +++++++++ ytsync/ytsync_test.go | 26 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 cmd/ytsync_test.go create mode 100644 ytsync/ytsync_test.go diff --git a/cmd/ytsync_test.go b/cmd/ytsync_test.go new file mode 100644 index 0000000..c539185 --- /dev/null +++ b/cmd/ytsync_test.go @@ -0,0 +1,9 @@ +package cmd + +import ( + "testing" +) + +func TestFetchChannels(t *testing.T) { + fetchChannels() +} diff --git a/ytsync/ytsync_test.go b/ytsync/ytsync_test.go new file mode 100644 index 0000000..b1346f0 --- /dev/null +++ b/ytsync/ytsync_test.go @@ -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() + } +}