<s> from datetime import date <EOL> import unittest <EOL> from mock import patch <EOL> from six import u <EOL> from twilio . rest . resources import Messages <EOL> DEFAULT = { <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> } <EOL> class MessageTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . resource = Messages ( "<STR_LIT:foo>" , ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> self . params = DEFAULT . copy ( ) <EOL> def test_list_on ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . list ( date_sent = date ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . params [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> mock . assert_called_with ( self . params ) <EOL> def test_list_after ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . list ( after = date ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . params [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> mock . assert_called_with ( self . params ) <EOL> def test_list_before ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . list ( before = date ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . params [ '<STR_LIT>' ] = "<STR_LIT>" <EOL> mock . assert_called_with ( self . params ) <EOL> def test_create ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . create ( <EOL> from_ = '<STR_LIT>' , <EOL> to = '<STR_LIT>' , <EOL> body = u ( '<STR_LIT>' ) , <EOL> ) <EOL> mock . assert_called_with ( <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:to>' : '<STR_LIT>' , <EOL> '<STR_LIT:body>' : u ( '<STR_LIT>' ) , <EOL> } , <EOL> ) <EOL> def test_delete ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . delete ( '<STR_LIT>' ) <EOL> mock . assert_called_with ( '<STR_LIT>' ) <EOL> def test_redact ( self ) : <EOL> with patch . object ( self . resource , '<STR_LIT>' ) as mock : <EOL> self . resource . redact ( '<STR_LIT>' ) <EOL> mock . assert_called_with ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) </s>
