(c *C)
| 663 | var _ = Suite(&PublishedRepoCollectionSuite{}) |
| 664 | |
| 665 | func (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 | |
| 698 | func (s *PublishedRepoCollectionSuite) TearDownTest(c *C) { |
| 699 | _ = s.db.Close() |
nothing calls this directly
no test coverage detected