How to use this_is_a_test method in Lemoncheesecake

Best Python code snippet using lemoncheesecake

test_send_email.py

Source:test_send_email.py Github

copy

Full Screen

1#!/usr/bin/env python2# Copyright 2013-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.3#4# Licensed under the Apache License, Version 2.0 (the "License"). You5# may not use this file except in compliance with the License. A copy of6# the License is located at7#8# http://aws.amazon.com/apache2.0/9#10# or in the "license" file accompanying this file. This file is11# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF12# ANY KIND, either express or implied. See the License for the specific13# language governing permissions and limitations under the License.14from awscli.testutils import BaseAWSCommandParamsTest15from awscli.compat import six16from six.moves import cStringIO17class TestSendEmail(BaseAWSCommandParamsTest):18 prefix = 'ses send-email'19 def test_plain_text(self):20 args = (' --subject This_is_a_test --from foo@bar.com'21 ' --to fie@baz.com --text This_is_the_message')22 args_list = (self.prefix + args).split()23 result = {24 'Source': 'foo@bar.com',25 'Destination': {'ToAddresses': ['fie@baz.com']},26 'Message': {'Body': {'Text': {'Data': 'This_is_the_message'}},27 'Subject': {'Data': 'This_is_a_test'}}}28 self.assert_params_for_cmd(args_list, result)29 def test_plain_text_multiple_to(self):30 args = (' --subject This_is_a_test --from foo@bar.com'31 ' --to fie1@baz.com fie2@baz.com --text This_is_the_message')32 args_list = (self.prefix + args).split()33 result = {'Source': 'foo@bar.com',34 'Destination': {35 'ToAddresses': ['fie1@baz.com', 'fie2@baz.com']},36 'Message': {37 'Body': {'Text': {'Data': 'This_is_the_message'}},38 'Subject': {'Data': 'This_is_a_test'}}}39 self.assert_params_for_cmd(args_list, result)40 def test_plain_text_multiple_cc(self):41 args = (' --subject This_is_a_test --from foo@bar.com'42 ' --to fie1@baz.com fie2@baz.com --text This_is_the_message'43 ' --cc fie3@baz.com fie4@baz.com')44 args_list = (self.prefix + args).split()45 result = {'Source': 'foo@bar.com',46 'Destination': {47 'CcAddresses': ['fie3@baz.com', 'fie4@baz.com'],48 'ToAddresses': ['fie1@baz.com', 'fie2@baz.com']},49 'Message': {50 'Body': {'Text': {'Data': 'This_is_the_message'}},51 'Subject': {'Data': 'This_is_a_test'}}}52 self.assert_params_for_cmd(args_list, result)53 def test_plain_text_multiple_bcc(self):54 args = (' --subject This_is_a_test --from foo@bar.com'55 ' --to fie1@baz.com fie2@baz.com --text This_is_the_message'56 ' --cc fie3@baz.com fie4@baz.com'57 ' --bcc fie5@baz.com fie6@baz.com')58 args_list = (self.prefix + args).split()59 result = {60 'Source': 'foo@bar.com',61 'Destination': {'BccAddresses': ['fie5@baz.com', 'fie6@baz.com'],62 'CcAddresses': ['fie3@baz.com', 'fie4@baz.com'],63 'ToAddresses': ['fie1@baz.com', 'fie2@baz.com']},64 'Message': {65 'Body': {'Text': {'Data': 'This_is_the_message'}},66 'Subject': {'Data': 'This_is_a_test'}}}67 self.assert_params_for_cmd(args_list, result)68 def test_html_text(self):69 args = (' --subject This_is_a_test --from foo@bar.com'70 ' --to fie@baz.com --html This_is_the_html_message')71 args_list = (self.prefix + args).split()72 result = {73 'Source': 'foo@bar.com',74 'Destination': {'ToAddresses': ['fie@baz.com']},75 'Message': {'Subject': {'Data': 'This_is_a_test'},76 'Body': {77 'Html': {'Data': 'This_is_the_html_message'}}}}78 self.assert_params_for_cmd(args_list, result)79 def test_html_both(self):80 args = (' --subject This_is_a_test --from foo@bar.com'81 ' --to fie@baz.com --html This_is_the_html_message'82 ' --text This_is_the_text_message')83 args_list = (self.prefix + args).split()84 result = {85 'Source': 'foo@bar.com',86 'Destination': {'ToAddresses': ['fie@baz.com']},87 'Message': {88 'Subject': {'Data': 'This_is_a_test'},89 'Body': {90 'Text': {'Data': 'This_is_the_text_message'},91 'Html': {'Data': 'This_is_the_html_message'}}}}92 self.assert_params_for_cmd(args_list, result)93 def test_using_json(self):94 args = (' --message {"Subject":{"Data":"This_is_a_test"},'95 '"Body":{"Text":{"Data":"This_is_the_message"}}}'96 ' --from foo@bar.com'97 ' --destination {"ToAddresses":["fie@baz.com"]}')98 args_list = (self.prefix + args).split()99 result = {'Destination': {'ToAddresses': ['fie@baz.com']},100 'Message': {101 'Subject': {102 'Data': 'This_is_a_test'},103 'Body': {104 'Text': {'Data': 'This_is_the_message'}}},105 'Source': 'foo@bar.com'}106 self.assert_params_for_cmd(args_list, result)107 def test_both_destination_and_to(self):108 args = (' --message {"Subject":{"Data":"This_is_a_test"},'109 '"Body":{"Text":{"Data":"This_is_the_message"}}}'110 ' --from foo@bar.com'111 ' --destination {"ToAddresses":["fie@baz.com"]}'112 ' --to fie2@baz.com')113 args_list = (self.prefix + args).split()114 self.run_cmd(args_list, expected_rc=255)115 def test_both_message_and_text(self):116 args = (' --message {"Subject":{"Data":"This_is_a_test"},'117 '"Body":{"Text":{"Data":"This_is_the_message"}}}'118 ' --from foo@bar.com'119 ' --destination {"ToAddresses":["fie@baz.com"]}'120 ' --text This_is_another_body')121 args_list = (self.prefix + args).split()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Lemoncheesecake automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful