'Test that config properly handles multiple instance types syntax
(within node_instance_type setting)'

def test_multiple_instance_types(self):

    invalid_cases = [{'c1_node_type': 'c1.xlarge:ami-asdffdas'}, {'c1_node_type': 'c1.xlarge:3'}, {'c1_node_type': 'c1.xlarge:ami-asdffdas:3'}, {'c1_node_type': 'c1.xlarge:asdf:asdf:asdf,m1.small'}, {'c1_node_type': 'c1.asdf:4,    m1.small'}, {'c1_node_type': 'c1.xlarge:    0,    m1.small'}, {'c1_node_type': 'c1.xlarge:-1,    m1.small'}]
    for case in invalid_cases:
        try:
            self.get_custom_config(**case)
        except exception.ConfigError:
            pass
        else:
            raise Exception((('config    allows    invalid    multiple    instance    ' + 'type    syntax:    %s') % case))
    valid_cases = [{'c1_node_type': 'c1.xlarge:3,    m1.small'}, {'c1_node_type': 'c1.xlarge:ami-asdfasdf:3,    m1.small'}, {'c1_node_type': 'c1.xlarge:ami-asdfasdf:3,    m1.large,    m1.small'}, {'c1_node_type': ('m1.large,    c1.xlarge:ami-asdfasdf:3,    m1.large,    ' + 'm1.small')}, {'c1_node_type': 'c1.xlarge:ami-asdfasdf:2,    m1.large:2,    m1.small'}]
    for case in valid_cases:
        try:
            self.get_custom_config(**case)
        except exception.ConfigError:
            raise Exception((('config    rejects    valid    multiple    instance    ' + 'type    syntax:    %s') % case))
