github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/testing/imports.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package testing
     5  
     6  import (
     7  	"github.com/juju/testing"
     8  	jc "github.com/juju/testing/checkers"
     9  	gc "gopkg.in/check.v1"
    10  )
    11  
    12  const jujuPkgPrefix = "github.com/juju/juju/"
    13  
    14  // FindJujuCoreImports returns a sorted list of juju-core packages that are
    15  // imported by the packageName parameter.  The resulting list removes the
    16  // common prefix "github.com/juju/juju/" leaving just the short names.
    17  func FindJujuCoreImports(c *gc.C, packageName string) []string {
    18  	imps, err := testing.FindImports(packageName, jujuPkgPrefix)
    19  	c.Assert(err, jc.ErrorIsNil)
    20  	return imps
    21  }