<s> import unittest <EOL> import httpretty <EOL> import pytest <EOL> from bravado . client import SwaggerClient <EOL> @ pytest . mark . xfail ( reason = '<STR_LIT>' ) <EOL> class ClientTest ( unittest . TestCase ) : <EOL> @ httpretty . activate <EOL> def test_post_check_headers ( self ) : <EOL> body = { "<STR_LIT:id>" : "<STR_LIT>" } <EOL> httpretty . register_uri ( <EOL> httpretty . POST , "<STR_LIT>" , <EOL> body = '<STR_LIT>' , content_type = '<STR_LIT>' ) <EOL> resp = self . client . simple1 . createAsterikInfoHttp ( body = body ) . result ( ) <EOL> self . assertEqual ( '<STR_LIT:application/json>' , <EOL> httpretty . last_request ( ) . headers [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> httpretty . last_request ( ) . body ) <EOL> self . assertEqual ( [ ] , resp ) <EOL> @ httpretty . activate <EOL> def test_bad_operation ( self ) : <EOL> try : <EOL> self . client . simple . doesNotExist ( ) <EOL> self . fail ( "<STR_LIT>" ) <EOL> except AttributeError : <EOL> pass <EOL> @ httpretty . activate <EOL> def test_bad_param ( self ) : <EOL> try : <EOL> self . client . simple . getAsteriskInfo ( doesNotExist = '<STR_LIT>' ) <EOL> self . fail ( "<STR_LIT>" ) <EOL> except TypeError : <EOL> pass <EOL> @ httpretty . activate <EOL> def test_missing_required ( self ) : <EOL> try : <EOL> self . client . simple1 . getAsteriskInfoHttp ( ) <EOL> self . fail ( "<STR_LIT>" ) <EOL> except TypeError : <EOL> pass <EOL> @ httpretty . activate <EOL> def setUp ( self ) : <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = open ( '<STR_LIT>' , '<STR_LIT:r>' ) . read ( ) ) <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = open ( '<STR_LIT>' , '<STR_LIT:r>' ) . read ( ) ) <EOL> httpretty . register_uri ( <EOL> httpretty . GET , "<STR_LIT>" , <EOL> body = open ( '<STR_LIT>' , '<STR_LIT:r>' ) . read ( ) ) <EOL> self . client = SwaggerClient . from_url ( u'<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
