Пример #1
0
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)
}