<s> import mock <EOL> import unittest <EOL> import uuid <EOL> def fake_id ( prefix ) : <EOL> entropy = '<STR_LIT>' . join ( [ a for a in str ( uuid . uuid4 ( ) ) if a . isalnum ( ) ] ) <EOL> return '<STR_LIT>' . format ( prefix , entropy ) <EOL> class APITestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( APITestCase , self ) . setUp ( ) <EOL> self . requestor_patcher = mock . patch ( '<STR_LIT>' ) <EOL> requestor_class_mock = self . requestor_patcher . start ( ) <EOL> self . requestor_mock = requestor_class_mock . return_value <EOL> def mock_response ( self , res ) : <EOL> self . requestor_mock . request = mock . Mock ( return_value = ( res , '<STR_LIT>' ) ) <EOL> class TestData ( object ) : <EOL> @ classmethod <EOL> def file_upload_response ( cls ) : <EOL> return { <EOL> '<STR_LIT:id>' : fake_id ( '<STR_LIT:file>' ) , <EOL> '<STR_LIT:object>' : '<STR_LIT:file>' , <EOL> } <EOL> @ classmethod <EOL> def evaluation_response ( cls ) : <EOL> return { <EOL> '<STR_LIT:id>' : fake_id ( '<STR_LIT:file>' ) , <EOL> '<STR_LIT:object>' : '<STR_LIT>' , <EOL> } </s>
