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

Method TestFilelist

gcs/public_test.go:126–150  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

124}
125
126func (s *PublishedStorageSuite) TestFilelist(c *C) {
127 paths := []string{"a", "b", "c", "testa", "test/a", "test/b", "lala/a", "lala/b", "lala/c"}
128 for _, path := range paths {
129 s.PutFile(c, path, []byte("test"))
130 }
131
132 list, err := s.storage.Filelist("")
133 c.Check(err, IsNil)
134 sort.Strings(list)
135 c.Check(list, DeepEquals, []string{"a", "b", "c", "lala/a", "lala/b", "lala/c", "test/a", "test/b", "testa"})
136
137 list, err = s.storage.Filelist("test")
138 c.Check(err, IsNil)
139 sort.Strings(list)
140 c.Check(list, DeepEquals, []string{"a", "b"})
141
142 list, err = s.storage.Filelist("test2")
143 c.Check(err, IsNil)
144 c.Check(list, DeepEquals, []string{})
145
146 list, err = s.prefixedStorage.Filelist("")
147 c.Check(err, IsNil)
148 sort.Strings(list)
149 c.Check(list, DeepEquals, []string{"a", "b", "c"})
150}
151
152func (s *PublishedStorageSuite) TestRemove(c *C) {
153 s.PutFile(c, "a/b", []byte("test"))

Callers

nothing calls this directly

Calls 4

PutFileMethod · 0.95
FilelistMethod · 0.65
CheckMethod · 0.45
StringsMethod · 0.45

Tested by

no test coverage detected