本文整理汇总了Python中pyrax.clouddns.DomainResultsIterator类的典型用法代码示例。如果您正苦于以下问题:Python DomainResultsIterator类的具体用法?Python DomainResultsIterator怎么用?Python DomainResultsIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DomainResultsIterator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_iter_items_next_fetch
def test_iter_items_next_fetch(self):
clt = self.client
mgr = clt._manager
fake_name = utils.random_unicode()
ret_body = {"domains": [{"name": fake_name}]}
clt.method_get = Mock(return_value=({}, ret_body))
res_iter = DomainResultsIterator(mgr)
res_iter.next_uri = example_uri
ret = res_iter.next()
self.assertTrue(isinstance(ret, CloudDNSDomain))
示例2: test_iter_items_first_fetch
def test_iter_items_first_fetch(self):
clt = self.client
mgr = clt._manager
fake_name = utils.random_name()
ret_body = {"domains": [{"name": fake_name}]}
clt.method_get = Mock(return_value=({}, ret_body))
res_iter = DomainResultsIterator(mgr)
ret = res_iter.next()
self.assertTrue(isinstance(ret, CloudDNSDomain))
clt.method_get.assert_called_once_with("/domains")
示例3: test_iter_items_next_stop
def test_iter_items_next_stop(self):
clt = self.client
mgr = clt._manager
res_iter = DomainResultsIterator(mgr)
res_iter.next_uri = None
self.assertRaises(StopIteration, res_iter.next)
示例4: test_iter
def test_iter(self):
clt = self.client
mgr = clt._manager
res_iter = DomainResultsIterator(mgr)
ret = res_iter.__iter__()
self.assertTrue(ret is res_iter)