<s> import os . path <EOL> from testutils . common_recordingtestcase import ( <EOL> RecordingTestCase , <EOL> TestMode , <EOL> ) <EOL> import tests . servicebus_settings_fake as fake_settings <EOL> class ServiceBusTestCase ( RecordingTestCase ) : <EOL> def setUp ( self ) : <EOL> self . working_folder = os . path . dirname ( __file__ ) <EOL> super ( ServiceBusTestCase , self ) . setUp ( ) <EOL> self . fake_settings = fake_settings <EOL> if TestMode . is_playback ( self . test_mode ) : <EOL> self . settings = self . fake_settings <EOL> else : <EOL> import tests . servicebus_settings_real as real_settings <EOL> self . settings = real_settings <EOL> def _set_service_options ( self , service , settings ) : <EOL> if settings . USE_PROXY : <EOL> service . set_proxy ( <EOL> settings . PROXY_HOST , <EOL> settings . PROXY_PORT , <EOL> settings . PROXY_USER , <EOL> settings . PROXY_PASSWORD , <EOL> ) <EOL> def _scrub ( self , val ) : <EOL> val = super ( ServiceBusTestCase , self ) . _scrub ( val ) <EOL> real_to_fake_dict = { <EOL> self . settings . SERVICEBUS_NAME : self . fake_settings . SERVICEBUS_NAME , <EOL> self . settings . EVENTHUB_NAME : self . fake_settings . EVENTHUB_NAME , <EOL> } <EOL> val = self . _scrub_using_dict ( val , real_to_fake_dict ) <EOL> return val </s>
