예제 #1
0
파일: system_test.go 프로젝트: gmelika/rack
func TestSystemGetBadStack(t *testing.T) {
	provider := StubAwsProvider(
		cycleDescribeStacksNotFound("convox"),
	)
	defer provider.Close()

	r, err := provider.SystemGet()

	assert.Nil(t, r)
	assert.Equal(t, aws.ErrorNotFound("convox not found"), err)
}
예제 #2
0
func TestFormationListBadApp(t *testing.T) {
	provider := StubAwsProvider(
		cycleDescribeStacksNotFound("convox-httpe"),
	)
	defer provider.Close()

	r, err := provider.FormationList("httpe")

	assert.Nil(t, r)
	assert.Equal(t, aws.ErrorNotFound("httpe not found"), err)
}
예제 #3
0
func TestFormationListBadRelease(t *testing.T) {
	provider := StubAwsProvider(
		cycleFormationDescribeStacks,
		cycleFormationDescribeStacks,
		cycleReleaseGetItemNotFound,
	)
	defer provider.Close()

	r, err := provider.FormationList("httpd")

	assert.Nil(t, r)
	assert.Equal(t, aws.ErrorNotFound("no such release: RVFETUHHKKD"), err)
}
예제 #4
0
func TestFormationSaveBadApp(t *testing.T) {
	provider := StubAwsProvider(
		cycleDescribeStacksNotFound("convox-httpe"),
	)
	defer provider.Close()

	pf := &structs.ProcessFormation{
		Name:   "web",
		Count:  1,
		Memory: 512,
		CPU:    256,
	}

	err := provider.FormationSave("httpe", pf)

	assert.Equal(t, aws.ErrorNotFound("httpe not found"), err)
}
예제 #5
0
func TestFormationSaveBadCluster(t *testing.T) {
	provider := StubAwsProvider(
		cycleFormationDescribeStacks,
		cycleCapacityListContainerInstancesBadCluster,
	)
	defer provider.Close()

	pf := &structs.ProcessFormation{
		Name:   "web",
		Count:  1,
		Memory: 512,
		CPU:    256,
	}

	err := provider.FormationSave("httpd", pf)

	assert.Equal(t, aws.ErrorNotFound("cluster not found: cluster-test"), err)
}