15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Copyright 2013 Google Inc. All Rights Reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Licensed under the Apache License, Version 2.0 (the "License"); 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# you may not use this file except in compliance with the License. 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# You may obtain a copy of the License at 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# http://www.apache.org/licenses/LICENSE-2.0 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Unless required by applicable law or agreed to in writing, 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# software distributed under the License is distributed on an 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# either express or implied. See the License for the specific 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# language governing permissions and limitations under the License. 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)"""Utils for testing.""" 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class MockUrlFetchResult(object): 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) def __init__(self, status, headers, body): 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) self.status_code = status 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) self.headers = headers 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) self.content = body 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) self.content_was_truncated = False 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) self.final_url = None 26