コード例 #1
0
 def test_that_when_listing_tags_fails_the_list_tags_method_returns_false(self):
     '''
     tests False tags not listed.
     '''
     self.conn.list_tags.side_effect = ClientError(error_content, 'list_tags')
     with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         result = boto_cloudtrail.list_tags(Name=trail_ret['Name'], **conn_parameters)
     self.assertTrue(result['error'])
コード例 #2
0
    def test_that_when_listing_tags_succeeds_the_list_tags_method_returns_true(self):
        '''
        tests True tags listed.
        '''
        with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_cloudtrail.list_tags(Name=trail_ret['Name'], **conn_parameters)

        self.assertEqual(result['tags'], {})
コード例 #3
0
ファイル: boto_cloudtrail_test.py プロジェクト: bryson/salt
 def test_that_when_listing_tags_fails_the_list_tags_method_returns_false(self):
     '''
     tests False tags not listed.
     '''
     self.conn.list_tags.side_effect = ClientError(error_content, 'list_tags')
     with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         result = boto_cloudtrail.list_tags(Name=trail_ret['Name'], **conn_parameters)
     self.assertTrue(result['error'])
コード例 #4
0
ファイル: boto_cloudtrail_test.py プロジェクト: bryson/salt
    def test_that_when_listing_tags_succeeds_the_list_tags_method_returns_true(self):
        '''
        tests True tags listed.
        '''
        with patch.dict(boto_cloudtrail.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_cloudtrail.list_tags(Name=trail_ret['Name'], **conn_parameters)

        self.assertEqual(result['tags'], {})
コード例 #5
0
 def test_that_when_listing_tags_fails_the_list_tags_method_returns_false(self):
     """
     tests False tags not listed.
     """
     self.conn.list_tags.side_effect = ClientError(error_content, "list_tags")
     with patch.dict(
         boto_cloudtrail.__salt__,
         {"boto_iam.get_account_id": MagicMock(return_value="1234")},
     ):
         result = boto_cloudtrail.list_tags(
             Name=trail_ret["Name"], **conn_parameters
         )
     self.assertTrue(result["error"])
コード例 #6
0
    def test_that_when_listing_tags_succeeds_the_list_tags_method_returns_true(self):
        """
        tests True tags listed.
        """
        with patch.dict(
            boto_cloudtrail.__salt__,
            {"boto_iam.get_account_id": MagicMock(return_value="1234")},
        ):
            result = boto_cloudtrail.list_tags(
                Name=trail_ret["Name"], **conn_parameters
            )

        self.assertEqual(result["tags"], {})