當前位置: 首頁>>代碼示例>>Python>>正文


Python ImageTruck.url方法代碼示例

本文整理匯總了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)
開發者ID:hmwalls,項目名稱:catsnap,代碼行數:12,代碼來源:test_image_truck.py

示例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')
開發者ID:hmwalls,項目名稱:catsnap,代碼行數:10,代碼來源:test_image_truck.py

示例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')
開發者ID:ErinCall,項目名稱:catsnap,代碼行數:15,代碼來源:test_image_truck.py

示例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')
開發者ID:pythonchelle,項目名稱:catsnap,代碼行數:8,代碼來源:test_image_truck.py

示例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')
開發者ID:pythonchelle,項目名稱:catsnap,代碼行數:8,代碼來源:test_image_truck.py

示例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')
開發者ID:pythonchelle,項目名稱:catsnap,代碼行數:7,代碼來源:test_image_truck.py


注:本文中的catsnap.image_truck.ImageTruck.url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。