(c *C)
| 46 | } |
| 47 | |
| 48 | func (s *PackagePoolSuite) TestFilepathList(c *C) { |
| 49 | list, err := s.pool.FilepathList(nil) |
| 50 | c.Check(err, IsNil) |
| 51 | c.Check(list, IsNil) |
| 52 | |
| 53 | _ = os.MkdirAll(filepath.Join(s.pool.rootPath, "bd", "0b"), 0755) |
| 54 | _ = os.MkdirAll(filepath.Join(s.pool.rootPath, "bd", "0a"), 0755) |
| 55 | _ = os.MkdirAll(filepath.Join(s.pool.rootPath, "ae", "0c"), 0755) |
| 56 | |
| 57 | list, err = s.pool.FilepathList(nil) |
| 58 | c.Check(err, IsNil) |
| 59 | c.Check(list, DeepEquals, []string{}) |
| 60 | |
| 61 | _ = os.WriteFile(filepath.Join(s.pool.rootPath, "ae", "0c", "1.deb"), nil, 0644) |
| 62 | _ = os.WriteFile(filepath.Join(s.pool.rootPath, "ae", "0c", "2.deb"), nil, 0644) |
| 63 | _ = os.WriteFile(filepath.Join(s.pool.rootPath, "bd", "0a", "3.deb"), nil, 0644) |
| 64 | _ = os.WriteFile(filepath.Join(s.pool.rootPath, "bd", "0b", "4.deb"), nil, 0644) |
| 65 | |
| 66 | list, err = s.pool.FilepathList(nil) |
| 67 | c.Check(err, IsNil) |
| 68 | c.Check(list, DeepEquals, []string{"ae/0c/1.deb", "ae/0c/2.deb", "bd/0a/3.deb", "bd/0b/4.deb"}) |
| 69 | } |
| 70 | |
| 71 | func (s *PackagePoolSuite) TestRemove(c *C) { |
| 72 | _ = os.MkdirAll(filepath.Join(s.pool.rootPath, "bd", "0b"), 0755) |
nothing calls this directly
no test coverage detected