MCPcopy Index your code
hub / github.com/aptly-dev/aptly / SetUpTest

Method SetUpTest

deb/publish_test.go:665–696  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

663var _ = Suite(&PublishedRepoCollectionSuite{})
664
665func (s *PublishedRepoCollectionSuite) SetUpTest(c *C) {
666 s.SetUpPackages()
667
668 s.db, _ = goleveldb.NewOpenDB(c.MkDir())
669 s.factory = NewCollectionFactory(s.db)
670
671 s.snapshotCollection = s.factory.SnapshotCollection()
672
673 snap1Refs := NewPackageRefList()
674 snap1Refs.Refs = [][]byte{s.p1.Key(""), s.p2.Key("")}
675 sort.Sort(snap1Refs)
676 s.snap1 = NewSnapshotFromRefList("snap1", []*Snapshot{}, snap1Refs, "desc1")
677
678 snap2Refs := NewPackageRefList()
679 snap2Refs.Refs = [][]byte{s.p3.Key("")}
680 sort.Sort(snap2Refs)
681 s.snap2 = NewSnapshotFromRefList("snap2", []*Snapshot{}, snap2Refs, "desc2")
682
683 _ = s.snapshotCollection.Add(s.snap1)
684 _ = s.snapshotCollection.Add(s.snap2)
685
686 s.localRepo = NewLocalRepo("local1", "comment1")
687 _ = s.factory.LocalRepoCollection().Add(s.localRepo)
688
689 s.repo1, _ = NewPublishedRepo("", "ppa", "anaconda", []string{}, []string{"main"}, []interface{}{s.snap1}, s.factory, false)
690 s.repo2, _ = NewPublishedRepo("", "", "anaconda", []string{}, []string{"main", "contrib"}, []interface{}{s.snap2, s.snap1}, s.factory, false)
691 s.repo3, _ = NewPublishedRepo("", "ppa", "anaconda", []string{}, []string{"main"}, []interface{}{s.snap2}, s.factory, false)
692 s.repo4, _ = NewPublishedRepo("", "ppa", "precise", []string{}, []string{"main"}, []interface{}{s.localRepo}, s.factory, false)
693 s.repo5, _ = NewPublishedRepo("files:other", "ppa", "precise", []string{}, []string{"main"}, []interface{}{s.localRepo}, s.factory, false)
694
695 s.collection = s.factory.PublishedRepoCollection()
696}
697
698func (s *PublishedRepoCollectionSuite) TearDownTest(c *C) {
699 _ = s.db.Close()

Callers

nothing calls this directly

Calls 13

NewOpenDBFunction · 0.92
NewCollectionFactoryFunction · 0.85
NewPackageRefListFunction · 0.85
NewSnapshotFromRefListFunction · 0.85
NewLocalRepoFunction · 0.85
NewPublishedRepoFunction · 0.85
SetUpPackagesMethod · 0.80
SnapshotCollectionMethod · 0.80
LocalRepoCollectionMethod · 0.80
MkDirMethod · 0.65
KeyMethod · 0.45

Tested by

no test coverage detected