当前位置: 首页>>代码示例>>Python>>正文


Python Shortener.qrcode方法代码示例

本文整理汇总了Python中pyshorteners.shorteners.Shortener.qrcode方法的典型用法代码示例。如果您正苦于以下问题:Python Shortener.qrcode方法的具体用法?Python Shortener.qrcode怎么用?Python Shortener.qrcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyshorteners.shorteners.Shortener的用法示例。


在下文中一共展示了Shortener.qrcode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_sentala_shortener

# 需要导入模块: from pyshorteners.shorteners import Shortener [as 别名]
# 或者: from pyshorteners.shorteners.Shortener import qrcode [as 别名]
    def test_sentala_shortener(self):
        engine = 'SentalaShortener'
        short = Shortener(engine)
        url = 'http://www.pilgrims.com'

        shorten = short.short(url)
        expand = short.expand(shorten)
        self.assertEqual(expand, url)
        self.assertEqual(short.qrcode(), 'http://chart.apis.google.com/'
                         'chart?cht=qr&chl={}&chs=120x120'.format(shorten))
开发者ID:praveenkishor123,项目名称:pyshorteners,代码行数:12,代码来源:test_shorteners.py

示例2: test_qrcx_shortener

# 需要导入模块: from pyshorteners.shorteners import Shortener [as 别名]
# 或者: from pyshorteners.shorteners.Shortener import qrcode [as 别名]
    def test_qrcx_shortener(self):
        engine = 'QrCxShortener'
        short = Shortener(engine)
        url = 'https://www.facebook.com/'

        shorten = short.short(url)
        expand = short.expand(shorten)
        self.assertEqual(expand, url)
        self.assertEqual(short.qrcode(), 'http://chart.apis.google.com/'
                         'chart?cht=qr&chl={}&chs=120x120'.format(shorten))
开发者ID:RandomStuffs22,项目名称:pyshorteners,代码行数:12,代码来源:test_shorteners.py

示例3: test_tinyurl_shortener

# 需要导入模块: from pyshorteners.shorteners import Shortener [as 别名]
# 或者: from pyshorteners.shorteners.Shortener import qrcode [as 别名]
    def test_tinyurl_shortener(self):
        engine = 'TinyurlShortener'
        short = Shortener(engine)
        url = 'http://tinyurl.com/nc9m936'
        shorten = short.short(self.test_url)
        self.assertEqual(shorten, url)

        self.assertEqual(short.expand(), self.test_url)
        self.assertEqual(short.expand(url), self.test_url)

        self.assertEqual(short.expanded, self.test_url)
        self.assertEqual(short.shorten, url)
        self.assertEqual(short.qrcode(), 'http://chart.apis.google.com/'
                         'chart?cht=qr&chl={}&chs=120x120'.format(shorten))
开发者ID:praveenkishor123,项目名称:pyshorteners,代码行数:16,代码来源:test_shorteners.py

示例4: test_googl_shortener

# 需要导入模块: from pyshorteners.shorteners import Shortener [as 别名]
# 或者: from pyshorteners.shorteners.Shortener import qrcode [as 别名]
    def test_googl_shortener(self):
        engine = 'GoogleShortener'
        short = Shortener(engine)
        url = 'http://goo.gl/rjf0oI'
        shorten = short.short(self.test_url)
        self.assertEqual(shorten, url)

        self.assertEqual(short.expand(), self.test_url)
        self.assertEqual(short.expanded, self.test_url)

        self.assertEqual(short.shorten, url)
        self.assertEqual(short.qrcode(), 'http://chart.apis.google.com/'
                         'chart?cht=qr&chl={}&chs=120x120'.format(shorten))

        #test exceptions
        with self.assertRaises(ExpandingErrorException):
            short.expand('http://www.a.co')
开发者ID:praveenkishor123,项目名称:pyshorteners,代码行数:19,代码来源:test_shorteners.py

示例5: test_none_qrcode

# 需要导入模块: from pyshorteners.shorteners import Shortener [as 别名]
# 或者: from pyshorteners.shorteners.Shortener import qrcode [as 别名]
 def test_none_qrcode(self):
     shortener = Shortener('TinyurlShortener')
     self.assertIsNone(shortener.qrcode())
开发者ID:RandomStuffs22,项目名称:pyshorteners,代码行数:5,代码来源:test_shorteners.py


注:本文中的pyshorteners.shorteners.Shortener.qrcode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。