// TODO: to test sub package info
to test sub package info
// TODO : to test sub package info
func (s *PakSuite) TestReadPakfile(c *C) {
	pakInfo := PakInfo{Packages: []PkgCfg{
		{
			Name:                   "github.com/test",
			PakName:                "pak",
			TargetBranch:           "origin/master",
			AutoMatchingHostBranch: false,
		},
		{
			Name:                   "github.com/test2",
			PakName:                "pak",
			TargetBranch:           "origin/master",
			AutoMatchingHostBranch: false,
		},
	}}
	pakInfoBytes, _ := goyaml.Marshal(&pakInfo)
	expectingPakInfo := PakInfo{
		Packages: []PkgCfg{
			{
				Name:                   "github.com/theplant/package1",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/theplant/package2",
				PakName:                "pak",
				TargetBranch:           "origin/dev",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/theplant/package3",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/theplant/package1-2",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/theplant/package2-2",
				PakName:                "pak",
				TargetBranch:           "origin/dev",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/theplant/package3-2",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/test",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
			{
				Name:                   "github.com/test2",
				PakName:                "pak",
				TargetBranch:           "origin/master",
				AutoMatchingHostBranch: false,
			},
		},
		BasicDependences: []string{"github.com/test", "github.com/test2"},
	}
	for _, pakfilePath := range pakfilePaths {
		ioutil.WriteFile(pakfilePath.path, pakInfoBytes, os.FileMode(0644))
		pakInfo2, _, err := GetPakInfo(GpiParams{
			Type:                 "10",
			Path:                 "",
			DeepParse:            true,
			WithBasicDependences: true,
		})
		c.Log(pakfilePath.msg)
		c.Check(err, pakfilePath.checker, nil)
		c.Check(pakInfo2, pakfilePath.pakInfoChecker, expectingPakInfo)
		os.Remove(pakfilePath.path)
	}
}
func ( s * PakSuite ) TestReadPakfile ( c * C ) { pakInfo := PakInfo { Packages : [ ] PkgCfg { { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , } } pakInfoBytes , _ := goyaml . Marshal ( & pakInfo ) expectingPakInfo := PakInfo { Packages : [ ] PkgCfg { { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , { Name : " " , PakName : " " , TargetBranch : " " , AutoMatchingHostBranch : false , } , } , BasicDependences : [ ] string { " " , " " } , } for _ , pakfilePath := range pakfilePaths { ioutil . WriteFile ( pakfilePath . path , pakInfoBytes , os . FileMode ( 0644 ) ) pakInfo2 , _ , err := GetPakInfo ( GpiParams { Type : " " , Path : " " , DeepParse : true , WithBasicDependences : true , } ) c . Log ( pakfilePath . msg ) c . Check ( err , pakfilePath . checker , nil ) c . Check ( pakInfo2 , pakfilePath . pakInfoChecker , expectingPakInfo ) os . Remove ( pakfilePath . path ) } }
to test sub package info
to test sub package info