From 1eeb249876668b69fab9db11a1fa484b1f0879f2 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 16 Jan 2017 10:38:58 +0700 Subject: [PATCH] add more integration tests for downloading data with the client --- integrationtests/client_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/integrationtests/client_test.go b/integrationtests/client_test.go index 12c8ce9fa..ee394185d 100644 --- a/integrationtests/client_test.go +++ b/integrationtests/client_test.go @@ -29,4 +29,24 @@ var _ = Describe("Client tests", func() { Expect(err).ToNot(HaveOccurred()) Expect(string(body)).To(Equal("Hello, World!\n")) }) + + It("downloads a small file", func() { + dataMan.GenerateData(dataLen) + resp, err := client.Get("https://quic.clemente.io:" + port + "/data") + Expect(err).ToNot(HaveOccurred()) + Expect(resp.StatusCode).To(Equal(200)) + body, err := ioutil.ReadAll(resp.Body) + Expect(err).ToNot(HaveOccurred()) + Expect(body).To(Equal(dataMan.GetData())) + }) + + It("downloads a large file", func() { + dataMan.GenerateData(dataLongLen) + resp, err := client.Get("https://quic.clemente.io:" + port + "/data") + Expect(err).ToNot(HaveOccurred()) + Expect(resp.StatusCode).To(Equal(200)) + body, err := ioutil.ReadAll(resp.Body) + Expect(err).ToNot(HaveOccurred()) + Expect(body).To(Equal(dataMan.GetData())) + }) })