From f4dc87fa44a64ab7e4b2bae9ab239758886f4a44 Mon Sep 17 00:00:00 2001 From: Lorenzo Bolla Date: Tue, 2 Feb 2021 14:25:54 +0100 Subject: [PATCH] Use a hostname more likely to be non-existent than localhost Otherwise, it's possible that certain network configuration defining *.localhost cause the tests to fail. --- http/download_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/download_test.go b/http/download_test.go index 8e40bbd1..21b13ef4 100644 --- a/http/download_test.go +++ b/http/download_test.go @@ -115,7 +115,7 @@ func (s *DownloaderSuite) TestDownload404(c *C) { } func (s *DownloaderSuite) TestDownloadConnectError(c *C) { - c.Assert(s.d.Download(s.ctx, "http://nosuch.localhost/", s.tempfile.Name()), + c.Assert(s.d.Download(s.ctx, "http://nosuch.host/", s.tempfile.Name()), ErrorMatches, ".*no such host") } @@ -138,7 +138,7 @@ func (s *DownloaderSuite) TestGetLength404(c *C) { } func (s *DownloaderSuite) TestGetLengthConnectError(c *C) { - _, err := s.d.GetLength(s.ctx, "http://nosuch.localhost/") + _, err := s.d.GetLength(s.ctx, "http://nosuch.host/") c.Assert(err, ErrorMatches, ".*no such host") }