(c *C)
| 424 | } |
| 425 | |
| 426 | func (s *RemoteRepoSuite) TestBuildDownloadQueueLatestOnly(c *C) { |
| 427 | s.repo.Architectures = []string{"i386"} |
| 428 | |
| 429 | err := s.repo.Fetch(s.downloader, nil, true) |
| 430 | c.Assert(err, IsNil) |
| 431 | |
| 432 | s.downloader.ExpectError("http://mirror.yandex.ru/debian/dists/squeeze/main/binary-i386/Packages.bz2", &http.Error{Code: 404}) |
| 433 | s.downloader.ExpectError("http://mirror.yandex.ru/debian/dists/squeeze/main/binary-i386/Packages.gz", &http.Error{Code: 404}) |
| 434 | s.downloader.ExpectResponse("http://mirror.yandex.ru/debian/dists/squeeze/main/binary-i386/Packages", examplePackagesFile) |
| 435 | |
| 436 | err = s.repo.DownloadPackageIndexes(s.progress, s.downloader, nil, s.collectionFactory, true, false) |
| 437 | c.Assert(err, IsNil) |
| 438 | c.Assert(s.downloader.Empty(), Equals, true) |
| 439 | |
| 440 | stanza := packageStanza.Copy() |
| 441 | stanza["Package"] = "amanda-client" |
| 442 | stanza["Version"] = "1:3.4.0-1" |
| 443 | stanza["Filename"] = "pool/main/a/amanda/amanda-client_3.4.0-1_i386.deb" |
| 444 | |
| 445 | newest := NewPackageFromControlFile(stanza) |
| 446 | _ = s.repo.packageList.Add(newest) |
| 447 | |
| 448 | queue, size, err := s.repo.BuildDownloadQueue(s.packagePool, s.collectionFactory.PackageCollection(), s.cs, false, true) |
| 449 | c.Assert(err, IsNil) |
| 450 | c.Check(queue, HasLen, 1) |
| 451 | c.Check(queue[0].File.DownloadURL(), Equals, "pool/main/a/amanda/amanda-client_3.4.0-1_i386.deb") |
| 452 | c.Check(size, Equals, int64(187518)) |
| 453 | } |
| 454 | |
| 455 | func (s *RemoteRepoSuite) TestDownloadWithSources(c *C) { |
| 456 | s.repo.Architectures = []string{"i386"} |
nothing calls this directly
no test coverage detected