MCPcopy Create free account
hub / github.com/aptly-dev/aptly / TestFilepathList

Method TestFilepathList

files/package_pool_test.go:48–69  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

46}
47
48func (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
71func (s *PackagePoolSuite) TestRemove(c *C) {
72 _ = os.MkdirAll(filepath.Join(s.pool.rootPath, "bd", "0b"), 0755)

Callers

nothing calls this directly

Calls 2

FilepathListMethod · 0.65
CheckMethod · 0.45

Tested by

no test coverage detected