<s> """<STR_LIT>""" <EOL> import os . path <EOL> from mock import patch <EOL> from tests import case <EOL> class AddVendorLibTest ( case . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def add_vendor_lib ( self ) : <EOL> """<STR_LIT>""" <EOL> from moztrap . deploy . paths import add_vendor_lib <EOL> add_vendor_lib ( ) <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> patcher = patch ( "<STR_LIT>" , [ "<STR_LIT>" ] ) <EOL> self . sys_path = patcher . start ( ) <EOL> self . addCleanup ( patcher . stop ) <EOL> patcher = patch ( "<STR_LIT>" ) <EOL> self . addsitedir = patcher . start ( ) <EOL> self . addCleanup ( patcher . stop ) <EOL> def test_calls_addsitedir ( self ) : <EOL> """<STR_LIT>""" <EOL> vendor_lib = os . path . abspath ( <EOL> os . path . join ( <EOL> os . path . dirname ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> self . add_vendor_lib ( ) <EOL> self . addsitedir . assert_called_with ( vendor_lib ) <EOL> def test_moves_new_paths_to_front ( self ) : <EOL> """<STR_LIT>""" <EOL> self . addsitedir . side_effect = lambda p : self . sys_path . append ( p ) <EOL> self . add_vendor_lib ( ) <EOL> self . assertEqual ( self . sys_path [ - <NUM_LIT:1> ] , "<STR_LIT>" ) </s>
