File: ppa_test.go

package info (click to toggle)
aptly 1.6.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,928 kB
  • sloc: python: 10,398; sh: 252; makefile: 184
file content (27 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package deb

import (
	"github.com/aptly-dev/aptly/utils"

	. "gopkg.in/check.v1"
)

type PpaSuite struct {
	config utils.ConfigStructure
}

var _ = Suite(&PpaSuite{})

func (s *PpaSuite) TestParsePPA(c *C) {
	_, _, _, err := ParsePPA("ppa:dedeed", &s.config)
	c.Check(err, ErrorMatches, "unable to parse ppa URL.*")

	s.config.PpaDistributorID = "debian"
	s.config.PpaCodename = "wheezy"

	url, distribution, components, err := ParsePPA("ppa:user/project", &s.config)
	c.Check(err, IsNil)
	c.Check(url, Equals, "http://ppa.launchpad.net/user/project/debian")
	c.Check(distribution, Equals, "wheezy")
	c.Check(components, DeepEquals, []string{"main"})
}