<s> import unittest <EOL> import os <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:0> , os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , <EOL> '<STR_LIT:..>' ) ) ) <EOL> from test_cases import utils <EOL> class CRMTask ( unittest . TestCase ) : <EOL> @ utils . allow ( services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def setUp ( self ) : <EOL> data = { <EOL> '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> self . obj = self . account . crm_tasks . create ( data = data ) <EOL> @ utils . allow ( services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def tearDown ( self ) : <EOL> self . obj . delete ( ) <EOL> @ utils . allow ( services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_list_object ( self ) : <EOL> objects = self . account . crm_tasks . all ( ) <EOL> if objects : <EOL> obj = objects [ <NUM_LIT:0> ] <EOL> self . assertEqual ( obj . type , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT>' in obj ) <EOL> @ utils . allow ( services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_read_object ( self ) : <EOL> obj = self . account . crm_tasks . retrieve ( self . obj . id ) <EOL> self . assertEqual ( obj . id , self . obj . id ) <EOL> self . assertEqual ( obj . type , '<STR_LIT>' ) <EOL> self . assertTrue ( '<STR_LIT>' in obj ) <EOL> self . assertTrue ( '<STR_LIT>' in obj ) <EOL> self . assertTrue ( '<STR_LIT>' in obj ) <EOL> self . assertTrue ( '<STR_LIT:description>' in obj ) <EOL> @ utils . allow ( services = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def test_update_object ( self ) : <EOL> obj = self . obj <EOL> obj . description = '<STR_LIT>' <EOL> obj . save ( ) <EOL> self . assertEqual ( '<STR_LIT>' , obj . description ) <EOL> def test_cases ( ) : <EOL> return [ utils . create_test_case ( acc , CRMTask ) for acc in utils . accounts ] <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> suite = utils . create_suite ( test_cases ( ) ) <EOL> unittest . TextTestRunner ( verbosity = <NUM_LIT:2> ) . run ( suite ) </s>
