<s> """<STR_LIT>""" <EOL> import os <EOL> import mox <EOL> class ExampleMoxTestMixin ( object ) : <EOL> """<STR_LIT>""" <EOL> def testStat ( self ) : <EOL> self . mox . StubOutWithMock ( os , '<STR_LIT>' ) <EOL> os . stat ( self . DIR_PATH ) <EOL> self . mox . ReplayAll ( ) <EOL> os . stat ( self . DIR_PATH ) <EOL> class ExampleMoxTest ( mox . MoxTestBase , ExampleMoxTestMixin ) : <EOL> DIR_PATH = '<STR_LIT>' <EOL> def testSuccess ( self ) : <EOL> self . mox . StubOutWithMock ( os , '<STR_LIT>' ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> self . mox . ReplayAll ( ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> def testExpectedNotCalled ( self ) : <EOL> self . mox . StubOutWithMock ( os , '<STR_LIT>' ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> self . mox . ReplayAll ( ) <EOL> def testUnexpectedCall ( self ) : <EOL> self . mox . StubOutWithMock ( os , '<STR_LIT>' ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> self . mox . ReplayAll ( ) <EOL> os . listdir ( '<STR_LIT>' ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> def testFailure ( self ) : <EOL> self . assertTrue ( False ) <EOL> def testStatOther ( self ) : <EOL> self . mox . StubOutWithMock ( os , '<STR_LIT>' ) <EOL> os . stat ( self . DIR_PATH ) <EOL> self . mox . ReplayAll ( ) <EOL> os . stat ( self . DIR_PATH ) <EOL> def testHasStubs ( self ) : <EOL> listdir_list = [ ] <EOL> def MockListdir ( directory ) : <EOL> listdir_list . append ( directory ) <EOL> self . stubs . Set ( os , '<STR_LIT>' , MockListdir ) <EOL> os . listdir ( self . DIR_PATH ) <EOL> self . assertEqual ( [ self . DIR_PATH ] , listdir_list ) <EOL> class TestClassFromAnotherModule ( object ) : <EOL> def __init__ ( self ) : <EOL> return None <EOL> def Value ( self ) : <EOL> return '<STR_LIT>' <EOL> class CallableClass ( object ) : <EOL> def __init__ ( self , one , two , nine = None ) : <EOL> pass <EOL> def __call__ ( self , one ) : <EOL> return '<STR_LIT>' <EOL> def Value ( ) : <EOL> return '<STR_LIT>' <EOL> def MyTestFunction ( one , two , nine = None ) : <EOL> pass </s>
