Esempio n. 1
0
    def test_that_when_checking_domain_status_and_boto3_returns_an_error_the_domain_status_method_returns_error(self):
        '''
        Tests checking domain existence when boto returns an error
        '''
        self.conn.describe_elasticsearch_domain.side_effect = ClientError(error_content, 'list_domains')
        result = boto_elasticsearch_domain.status(DomainName='mydomain', **conn_parameters)

        self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_domains'))
Esempio n. 2
0
    def test_that_when_checking_domain_status_and_a_domain_exists_the_domain_status_method_returns_info(self):
        '''
        Tests checking domain existence when the domain already exists
        '''
        self.conn.describe_elasticsearch_domain.return_value = {'DomainStatus': domain_ret}
        result = boto_elasticsearch_domain.status(DomainName='testdomain', **conn_parameters)

        self.assertTrue(result['domain'])
    def test_that_when_checking_domain_status_and_boto3_returns_an_error_the_domain_status_method_returns_error(self):
        '''
        Tests checking domain existence when boto returns an error
        '''
        self.conn.describe_elasticsearch_domain.side_effect = ClientError(error_content, 'list_domains')
        result = boto_elasticsearch_domain.status(DomainName='mydomain', **conn_parameters)

        self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_domains'))
    def test_that_when_checking_domain_status_and_a_domain_exists_the_domain_status_method_returns_info(self):
        '''
        Tests checking domain existence when the domain already exists
        '''
        self.conn.describe_elasticsearch_domain.return_value = {'DomainStatus': domain_ret}
        result = boto_elasticsearch_domain.status(DomainName='testdomain', **conn_parameters)

        self.assertTrue(result['domain'])
    def test_that_when_checking_domain_status_and_a_domain_exists_the_domain_status_method_returns_info(
        self, ):
        """
        Tests checking domain existence when the domain already exists
        """
        self.conn.describe_elasticsearch_domain.return_value = {
            "DomainStatus": domain_ret
        }
        result = boto_elasticsearch_domain.status(DomainName="testdomain",
                                                  **conn_parameters)

        self.assertTrue(result["domain"])
    def test_that_when_checking_domain_status_and_boto3_returns_an_error_the_domain_status_method_returns_error(
        self, ):
        """
        Tests checking domain existence when boto returns an error
        """
        self.conn.describe_elasticsearch_domain.side_effect = ClientError(
            error_content, "list_domains")
        result = boto_elasticsearch_domain.status(DomainName="mydomain",
                                                  **conn_parameters)

        assert result.get(
            "error", {}).get("message") == error_message.format("list_domains")