示例#1
0
func (s filepathSuite) TestNewRendererUnix(c *gc.C) {
	for _, os := range utils.OSUnix {
		c.Logf("trying %q", os)
		renderer, err := filepath.NewRenderer(os)
		c.Assert(err, jc.ErrorIsNil)

		s.checkRenderer(c, renderer, "unix")
	}
}
示例#2
0
func (s filepathSuite) TestNewRendererDistros(c *gc.C) {
	distros := []string{"ubuntu"}
	for _, distro := range distros {
		c.Logf("trying %q", distro)
		renderer, err := filepath.NewRenderer(distro)
		c.Assert(err, jc.ErrorIsNil)

		s.checkRenderer(c, renderer, "unix")
	}
}
示例#3
0
func (s filepathSuite) TestNewRendererGOOS(c *gc.C) {
	// All possible values of runtime.GOOS should be supported.
	renderer, err := filepath.NewRenderer(runtime.GOOS)
	c.Assert(err, jc.ErrorIsNil)

	switch runtime.GOOS {
	case "windows":
		s.checkRenderer(c, renderer, "windows")
	default:
		s.checkRenderer(c, renderer, "unix")
	}
}
示例#4
0
func (s filepathSuite) TestNewRendererUnknown(c *gc.C) {
	_, err := filepath.NewRenderer("<unknown OS>")

	c.Check(err, jc.Satisfies, errors.IsNotFound)
}
示例#5
0
func (s filepathSuite) TestNewRendererWindows(c *gc.C) {
	renderer, err := filepath.NewRenderer("windows")
	c.Assert(err, jc.ErrorIsNil)

	s.checkRenderer(c, renderer, "windows")
}