New upstream version 1.4.0+ds1

This commit is contained in:
Sébastien Delafond
2019-12-22 14:57:35 +01:00
parent 8fa7bc9206
commit 29e4ea6ec0
215 changed files with 4919 additions and 1878 deletions
+19
View File
@@ -123,3 +123,22 @@ func (s *DownloaderSuite) TestDownloadFileError(c *C) {
c.Assert(s.d.Download(s.ctx, s.url+"/test", "/"),
ErrorMatches, ".*permission denied")
}
func (s *DownloaderSuite) TestGetLength(c *C) {
size, err := s.d.GetLength(s.ctx, s.url+"/test")
c.Assert(err, IsNil)
c.Assert(size, Equals, int64(12))
}
func (s *DownloaderSuite) TestGetLength404(c *C) {
_, err := s.d.GetLength(s.ctx, s.url+"/doesntexist")
c.Assert(err, ErrorMatches, "HTTP code 404.*")
}
func (s *DownloaderSuite) TestGetLengthConnectError(c *C) {
_, err := s.d.GetLength(s.ctx, "http://nosuch.localhost/")
c.Assert(err, ErrorMatches, ".*no such host")
}