本文整理匯總了Python中embedly.client.Embedly.get_services方法的典型用法代碼示例。如果您正苦於以下問題:Python Embedly.get_services方法的具體用法?Python Embedly.get_services怎麽用?Python Embedly.get_services使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類embedly.client.Embedly
的用法示例。
在下文中一共展示了Embedly.get_services方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_services_remains_empty_on_failed_http
# 需要導入模塊: from embedly.client import Embedly [as 別名]
# 或者: from embedly.client.Embedly import get_services [as 別名]
def test_services_remains_empty_on_failed_http(self, MockHttp):
MockHttp.return_value.request.return_value = ({'status': 500}, "")
client = Embedly(self.key)
client.get_services()
self.assertFalse(client.services)
self.assertTrue(MockHttp.return_value.request.called)
示例2: test_get_services_retrieves_data_and_builds_regex
# 需要導入模塊: from embedly.client import Embedly [as 別名]
# 或者: from embedly.client.Embedly import get_services [as 別名]
def test_get_services_retrieves_data_and_builds_regex(self):
client = Embedly(self.key)
client.get_services()
self.assertGreater(len(client.services), 0)
self.assertTrue(client.regex.match('http://yfrog.com/h22eu4j'))
示例3: test_services_can_be_manually_configured
# 需要導入模塊: from embedly.client import Embedly [as 別名]
# 或者: from embedly.client.Embedly import get_services [as 別名]
def test_services_can_be_manually_configured(self):
client = Embedly(self.key)
client.services = ['nothing', 'like', 'real', 'response', 'data']
self.assertTrue('nothing' in client.get_services())
self.assertEqual(len(client.get_services()), 5)