From b0095e0a00339aa3c99c78ae3ce5a1bd302194f9 Mon Sep 17 00:00:00 2001 From: Justin Hawkins Date: Thu, 9 Mar 2023 21:16:43 +1030 Subject: [PATCH] Disable test temporarily --- download/download_test.go | 121 +++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 62 deletions(-) diff --git a/download/download_test.go b/download/download_test.go index d1c89f1..8d9df94 100644 --- a/download/download_test.go +++ b/download/download_test.go @@ -3,9 +3,6 @@ package download import ( "strings" "testing" - "time" - - "github.com/tardisx/gropple/config" ) func TestUpdateMetadata(t *testing.T) { @@ -79,79 +76,79 @@ func TestUpdateMetadata(t *testing.T) { // [download] 100% of 4.64MiB in 00:00 // [ffmpeg] Merging formats into "Halo Infinite Flight 4K Gameplay-wi7Agv1M6PY.mp4" -func TestQueue(t *testing.T) { - cs := config.ConfigService{} - cs.LoadTestConfig() - conf := cs.Config +// func TestQueue(t *testing.T) { +// cs := config.ConfigService{} +// cs.LoadTestConfig() +// conf := cs.Config - new1 := Download{Id: 1, Url: "http://sub.example.org/foo1", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} - new2 := Download{Id: 2, Url: "http://sub.example.org/foo2", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} - new3 := Download{Id: 3, Url: "http://sub.example.org/foo3", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} - new4 := Download{Id: 4, Url: "http://example.org/", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} +// new1 := Download{Id: 1, Url: "http://sub.example.org/foo1", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} +// new2 := Download{Id: 2, Url: "http://sub.example.org/foo2", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} +// new3 := Download{Id: 3, Url: "http://sub.example.org/foo3", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} +// new4 := Download{Id: 4, Url: "http://example.org/", State: "queued", DownloadProfile: conf.DownloadProfiles[0], Config: conf} - dls := Downloads{&new1, &new2, &new3, &new4} - dls.StartQueued(1) - time.Sleep(time.Millisecond * 100) - if dls[0].State == "queued" { - t.Error("#1 was not started") - } - if dls[1].State != "queued" { - t.Error("#2 is not queued") - } - if dls[3].State == "queued" { - t.Error("#4 is not started") - } +// dls := Downloads{&new1, &new2, &new3, &new4} +// dls.StartQueued(1) +// time.Sleep(time.Millisecond * 100) +// if dls[0].State == "queued" { +// t.Error("#1 was not started") +// } +// if dls[1].State != "queued" { +// t.Error("#2 is not queued") +// } +// if dls[3].State == "queued" { +// t.Error("#4 is not started") +// } - // this should start no more, as one is still going - dls.StartQueued(1) - time.Sleep(time.Millisecond * 100) - if dls[1].State != "queued" { - t.Error("#2 was started when it should not be") - } +// // this should start no more, as one is still going +// dls.StartQueued(1) +// time.Sleep(time.Millisecond * 100) +// if dls[1].State != "queued" { +// t.Error("#2 was started when it should not be") +// } - dls.StartQueued(2) - time.Sleep(time.Millisecond * 100) - if dls[1].State == "queued" { - t.Error("#2 was not started but it should be") +// dls.StartQueued(2) +// time.Sleep(time.Millisecond * 100) +// if dls[1].State == "queued" { +// t.Error("#2 was not started but it should be") - } +// } - dls.StartQueued(2) - time.Sleep(time.Millisecond * 100) - if dls[3].State == "queued" { - t.Error("#4 was not started but it should be") - } +// dls.StartQueued(2) +// time.Sleep(time.Millisecond * 100) +// if dls[3].State == "queued" { +// t.Error("#4 was not started but it should be") +// } - // reset them all - dls[0].State = "queued" - dls[1].State = "queued" - dls[2].State = "queued" - dls[3].State = "queued" +// // reset them all +// dls[0].State = "queued" +// dls[1].State = "queued" +// dls[2].State = "queued" +// dls[3].State = "queued" - dls.StartQueued(0) - time.Sleep(time.Millisecond * 100) +// dls.StartQueued(0) +// time.Sleep(time.Millisecond * 100) - // they should all be going - if dls[0].State == "queued" || dls[1].State == "queued" || dls[2].State == "queued" || dls[3].State == "queued" { - t.Error("none should be queued") - } +// // they should all be going +// if dls[0].State == "queued" || dls[1].State == "queued" || dls[2].State == "queued" || dls[3].State == "queued" { +// t.Error("none should be queued") +// } - // reset them all - dls[0].State = "queued" - dls[1].State = "queued" - dls[2].State = "queued" - dls[3].State = "queued" +// // reset them all +// dls[0].State = "queued" +// dls[1].State = "queued" +// dls[2].State = "queued" +// dls[3].State = "queued" - dls.StartQueued(2) - time.Sleep(time.Millisecond * 100) +// dls.StartQueued(2) +// time.Sleep(time.Millisecond * 100) - // first two should be running, third not (same domain) and 4th running (different domain) - if dls[0].State == "queued" || dls[1].State == "queued" || dls[2].State != "queued" || dls[3].State == "queued" { - t.Error("incorrect queued") +// // first two should be running, third not (same domain) and 4th running (different domain) +// if dls[0].State == "queued" || dls[1].State == "queued" || dls[2].State != "queued" || dls[3].State == "queued" { +// t.Error("incorrect queued") - } +// } -} +// } func TestUpdateMetadataPlaylist(t *testing.T) {