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

Method TestAddByName

deb/local_test.go:101–117  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

99}
100
101func (s *LocalRepoCollectionSuite) TestAddByName(c *C) {
102 _, err := s.collection.ByName("local1")
103 c.Assert(err, ErrorMatches, "*.not found")
104
105 repo := NewLocalRepo("local1", "Comment 1")
106 c.Assert(s.collection.Add(repo), IsNil)
107 c.Assert(s.collection.Add(repo), ErrorMatches, ".*already exists")
108
109 r, err := s.collection.ByName("local1")
110 c.Assert(err, IsNil)
111 c.Assert(r.String(), Equals, repo.String())
112
113 collection := NewLocalRepoCollection(s.db)
114 r, err = collection.ByName("local1")
115 c.Assert(err, IsNil)
116 c.Assert(r.String(), Equals, repo.String())
117}
118
119func (s *LocalRepoCollectionSuite) TestByUUID(c *C) {
120 _, err := s.collection.ByUUID("some-uuid")

Callers

nothing calls this directly

Calls 6

ByNameMethod · 0.95
StringMethod · 0.95
NewLocalRepoFunction · 0.85
NewLocalRepoCollectionFunction · 0.85
StringMethod · 0.65
AddMethod · 0.45

Tested by

no test coverage detected