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'])
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'], {})
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"])
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"], {})