#NEWLINE# def testUpdateCatalogIfChangedWhenOtherStatusCode( self ) : #NEWLINE# #INDENT# 'Test _UpdateCatalogIfChanged().' #NEWLINE# self . mox . StubOutWithMock ( applesus . urlfetch , 'fetch' ) #NEWLINE# self . mox . StubOutWithMock ( deadline . c , '_UpdateCatalog' ) #NEWLINE# deadline = 30 #NEWLINE# catalog = self . mox . CreateMockAnything ( ) #NEWLINE# catalog . last_modified_header = 'lmh' #NEWLINE# headers = { #NEWLINE# #INDENT# 'If-Modified-Since' : catalog . last_modified_header , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . mox . CreateMockAnything ( ) #NEWLINE# response . status_code = 404 #NEWLINE# url = applesus . CATALOGS . values ( ) [ 0 ] #NEWLINE# applesus . urlfetch . fetch ( url , headers = headers , deadline = deadline , validate_certificate = True ) . AndReturn ( response ) #NEWLINE# self . mox . ReplayAll ( ) #NEWLINE# self . assertRaises ( applesus . urlfetch . DownloadError , self . c . _UpdateCatalogIfChanged , catalog , url ) #NEWLINE# self . mox . VerifyAll ( )