コード例 #1
0
ファイル: boto_cloudtrail_test.py プロジェクト: bryson/salt
 def test_that_when_adding_tags_fails_the_add_tags_method_returns_false(self):
     '''
     tests False tags not added.
     '''
     self.conn.add_tags.side_effect = ClientError(error_content, 'add_tags')
     with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         result = boto_cloudtrail.add_tags(Name=trail_ret['Name'], a='b', **conn_parameters)
     self.assertFalse(result['tagged'])
コード例 #2
0
ファイル: boto_cloudtrail_test.py プロジェクト: bryson/salt
    def test_that_when_adding_tags_succeeds_the_add_tags_method_returns_true(self):
        '''
        tests True tags added.
        '''
        with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_cloudtrail.add_tags(Name=trail_ret['Name'], a='b', **conn_parameters)

        self.assertTrue(result['tagged'])
コード例 #3
0
 def test_that_when_adding_tags_fails_the_add_tags_method_returns_false(
         self):
     '''
     tests False tags not added.
     '''
     self.conn.add_tags.side_effect = ClientError(error_content, 'add_tags')
     with patch.dict(
             boto_cloudtrail.__salt__,
         {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         result = boto_cloudtrail.add_tags(Name=trail_ret['Name'],
                                           a='b',
                                           **conn_parameters)
     self.assertFalse(result['tagged'])
コード例 #4
0
    def test_that_when_adding_tags_succeeds_the_add_tags_method_returns_true(
            self):
        '''
        tests True tags added.
        '''
        with patch.dict(
                boto_cloudtrail.__salt__,
            {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_cloudtrail.add_tags(Name=trail_ret['Name'],
                                              a='b',
                                              **conn_parameters)

        self.assertTrue(result['tagged'])
コード例 #5
0
 def test_that_when_adding_tags_fails_the_add_tags_method_returns_false(
         self):
     """
     tests False tags not added.
     """
     self.conn.add_tags.side_effect = ClientError(error_content, "add_tags")
     with patch.dict(
             boto_cloudtrail.__salt__,
         {"boto_iam.get_account_id": MagicMock(return_value="1234")},
     ):
         result = boto_cloudtrail.add_tags(Name=trail_ret["Name"],
                                           a="b",
                                           **conn_parameters)
     self.assertFalse(result["tagged"])
コード例 #6
0
    def test_that_when_adding_tags_succeeds_the_add_tags_method_returns_true(
            self):
        """
        tests True tags added.
        """
        with patch.dict(
                boto_cloudtrail.__salt__,
            {"boto_iam.get_account_id": MagicMock(return_value="1234")},
        ):
            result = boto_cloudtrail.add_tags(Name=trail_ret["Name"],
                                              a="b",
                                              **conn_parameters)

        self.assertTrue(result["tagged"])