| 332 | } |
| 333 | |
| 334 | func (s *PackagePoolSuite) TestOpen(c *C) { |
| 335 | path, err := s.pool.Import(s.debFile, filepath.Base(s.debFile), &s.checksum, false, s.cs) |
| 336 | c.Check(err, IsNil) |
| 337 | |
| 338 | f, err := s.pool.Open(path) |
| 339 | c.Assert(err, IsNil) |
| 340 | contents, err := io.ReadAll(f) |
| 341 | c.Assert(err, IsNil) |
| 342 | c.Check(len(contents), Equals, 2738) |
| 343 | c.Check(f.Close(), IsNil) |
| 344 | |
| 345 | _, err = s.pool.Open("do/es/ntexist") |
| 346 | c.Assert(os.IsNotExist(err), Equals, true) |
| 347 | } |
| 348 | |
| 349 | func (s *PackagePoolSuite) TestLink(c *C) { |
| 350 | path, err := s.pool.Import(s.debFile, filepath.Base(s.debFile), &s.checksum, false, s.cs) |