本文整理匯總了Python中catsnap.image_truck.ImageTruck.url方法的典型用法代碼示例。如果您正苦於以下問題:Python ImageTruck.url方法的具體用法?Python ImageTruck.url怎麽用?Python ImageTruck.url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類catsnap.image_truck.ImageTruck
的用法示例。
在下文中一共展示了ImageTruck.url方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_url__with_extension
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url__with_extension(self, calculate_filename, Config, _url):
config = Mock()
config.bucket_name.return_value = 'tune-carrier'
Config.return_value = config
calculate_filename.return_value = 'greensleeves'
truck = ImageTruck('greensleeves', None, None)
truck.url(extension=True)
_url.assert_called_once_with('greensleeves', 'tune-carrier',
extension=True)
示例2: test_url
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url(self, calculate_filename, Config):
config = Mock()
config.bucket_name.return_value = 'tune-carrier'
Config.return_value = config
calculate_filename.return_value = 'greensleeves'
truck = ImageTruck('greensleeves', None, None)
eq_(truck.url(), 'https://s3.amazonaws.com/tune-carrier/greensleeves')
示例3: test_url__with_cloudfront_url
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url__with_cloudfront_url(self, calculate_filename, MockClient):
client = Mock()
client.cloudfront_url.return_value = \
'ggaaghlhaagl.cloudfront.net'
client.config.return_value = Client().config()
MockClient.return_value = client
calculate_filename.return_value = 'chumbawamba'
truck = ImageTruck('tubthumper', None, None)
url = truck.url()
eq_(url, 'https://ggaaghlhaagl.cloudfront.net/chumbawamba')
client.cloudfront_url.assert_called_with('JEEZAMANDA')
示例4: test_url__with_extension
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url__with_extension(self, calculate_filename):
calculate_filename.return_value = 'greensleeves'
truck = ImageTruck('greensleeves', None, None)
url = truck.url()
eq_(url, 'https://s3.amazonaws.com/tune/greensleeves#.gif')
示例5: test_url__with_cloudfront_url
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url__with_cloudfront_url(self, calculate_filename):
calculate_filename.return_value = 'chumbawamba'
truck = ImageTruck('tubthumper', None, None)
url = truck.url()
eq_(url, 'https://ggaaghlhaagl.cloudfront.net/chumbawamba')
示例6: test_url
# 需要導入模塊: from catsnap.image_truck import ImageTruck [as 別名]
# 或者: from catsnap.image_truck.ImageTruck import url [as 別名]
def test_url(self, calculate_filename):
calculate_filename.return_value = 'greensleeves'
truck = ImageTruck('greensleeves', None, None)
eq_(truck.url(), 'https://s3.amazonaws.com/tune-carrier/greensleeves')