<commit_before>package ec2

import (
	"launchpad.net/goamz/aws"
	. "launchpad.net/gocheck"
	"launchpad.net/juju/go/juju"
	"strings"
)

var testRegion = aws.Region{
	EC2Endpoint: "testregion.nowhere:1234",
}

var configTests = []struct {
	env    string
	config *providerConfig
	err    string
}{
	{"type: ec2\n", &providerConfig{region: aws.USEast}, ""},
	{"type: ec2\nregion: eu-west-1\n", &providerConfig{region: aws.EUWest}, ""},
	{"type: ec2\nregion: unknown\n", nil, ".*invalid region name.*"},
	{"type: ec2\nregion: test\n", &providerConfig{region: testRegion}, ""},
	{"type: ec2\nregion: deleted\n", nil, ".*invalid region name.*"},
}

func indent(s string, with string) string {
	var r string
	lines := strings.Split(s, "\n")
	for _, l := range lines {
		r += with + l + "\n"<commit_msg>added test for invalid type of region attribute<commit_after>package ec2

import (
	"launchpad.net/goamz/aws"
	. "launchpad.net/gocheck"
	"launchpad.net/juju/go/juju"
	"strings"
)

var testRegion = aws.Region{
	EC2Endpoint: "testregion.nowhere:1234",
}

var configTests = []struct {
	env    string
	config *providerConfig
	err    string
}{
	{"type: ec2\n", &providerConfig{region: aws.USEast}, ""},
	{"type: ec2\nregion: eu-west-1\n", &providerConfig{region: aws.EUWest}, ""},
	{"type: ec2\nregion: unknown\n", nil, ".*invalid region name.*"},
	{"type: ec2\nregion: test\n", &providerConfig{region: testRegion}, ""},
	{"type: ec2\nregion: deleted\n", nil, ".*invalid region name.*"},
	{"type: ec2\nregion: 666\n", nil, ".*expected string, got 666"},
}

func indent(s string, with string) string {
	var r string
	lines := strings.Split(s, "\n")
	for _, l := range lines {
		r += with + l + "\n"
{'fraction_non_alphanumeric': 0.18979833926453143, 'fraction_numerical': 0.018386714116251483, 'mean_word_length': 4.3386075949367084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4703501', 'n_tokens_mistral': 661, 'n_tokens_neox': 634, 'n_words': 152}