本文整理匯總了Golang中github.com/harbur/captain/Godeps/_workspace/src/github.com/stretchr/testify/assert.Equal函數的典型用法代碼示例。如果您正苦於以下問題:Golang Equal函數的具體用法?Golang Equal怎麽用?Golang Equal使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Equal函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestFilterConfigWeb
func TestFilterConfigWeb(t *testing.T) {
c := NewConfig("", "test/Simple/captain.yml", false)
assert.Equal(t, 2, len(c.GetApps()), "Should return 2 apps")
c.FilterConfig("web")
assert.Equal(t, 1, len(c.GetApps()), "Should return 1 app")
assert.Equal(t, "Dockerfile", c.GetApp("web").Build, "Should return web Build field")
}
示例2: TestFilterConfigEmpty
func TestFilterConfigEmpty(t *testing.T) {
c := NewConfig("", "test/Simple/captain.yml", false)
assert.Equal(t, 2, len(c.GetApps()), "Should return 2 apps")
res := c.FilterConfig("")
assert.True(t, res, "Should return true")
assert.Equal(t, 2, len(c.GetApps()), "Should return 2 apps")
}
示例3: TestFilterConfigNonExistent
func TestFilterConfigNonExistent(t *testing.T) {
c := NewConfig("", "test/Simple/captain.yml", false)
assert.Equal(t, 2, len(c.GetApps()), "Should return 2 apps")
res := c.FilterConfig("nonexistent")
assert.False(t, res, "Should return false")
assert.Equal(t, 0, len(c.GetApps()), "Should return 0 apps")
}
示例4: TestTagNonexistingImage
func TestTagNonexistingImage(t *testing.T) {
app := App{Image: "golang"}
res := tagImage(app, "nonexist", "testing")
expected := errors.New("no such image")
assert.Equal(t, expected, res, "Docker tag should return an error")
println()
}
示例5: TestGitIsDirty
func TestGitIsDirty(t *testing.T) {
assert.Equal(t, false, isDirty(), "Git should not have local changes")
}
示例6: TestGitGetBranch
func TestGitGetBranch(t *testing.T) {
assert.Equal(t, "master", getBranch(), "Git branch should be master")
}
示例7: TestExecute
func TestExecute(t *testing.T) {
res := execute("echo", "testing")
assert.Equal(t, nil, res, "it should execute without errors")
}
示例8: TestOnelinerTrimmed
func TestOnelinerTrimmed(t *testing.T) {
res, _ := oneliner("echo", "testing with spaces ")
assert.Equal(t, "testing with spaces", res, "it should return the trimmed result")
}
示例9: TestGitGetBranchAllBranches
func TestGitGetBranchAllBranches(t *testing.T) {
assert.Equal(t, []string{"master"}, getBranches(true), "Git branch should be master")
}
示例10: TestGitGetRevisionFullSha
func TestGitGetRevisionFullSha(t *testing.T) {
assert.Equal(t, 40, len(getRevision(true)), "Git revision should have a length of 40 chars")
}
示例11: TestImageExist
func TestImageExist(t *testing.T) {
app := App{Image: "golang"}
exist := imageExist(app, "1.4")
assert.Equal(t, true, exist, "Docker image golang:1.4 should exist")
}
示例12: TestConfigFiles
func TestConfigFiles(t *testing.T) {
options.config = "captain.yml"
c := configFile(options)
sl := "captain.yml"
assert.Equal(t, sl, c, "Should return possible config files")
}
示例13: TestGetApp
func TestGetApp(t *testing.T) {
options.config = "test/Simple/captain.yml"
c := NewConfig(options, false)
app := c.GetApp("web")
assert.Equal(t, "harbur/test_web", app.Image, "Should return web image")
}
示例14: TestGitIsGit
func TestGitIsGit(t *testing.T) {
assert.Equal(t, true, isGit(), "There should be a git repository")
}
示例15: TestImageDoesNotExist
func TestImageDoesNotExist(t *testing.T) {
app := App{Image: "golang"}
exist := imageExist(app, "nonexist")
assert.Equal(t, false, exist, "Docker image golang:nonexist should not exist")
}