本文整理匯總了Python中autofixture.base.Link.get_deep_links方法的典型用法代碼示例。如果您正苦於以下問題:Python Link.get_deep_links方法的具體用法?Python Link.get_deep_links怎麽用?Python Link.get_deep_links使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類autofixture.base.Link
的用法示例。
在下文中一共展示了Link.get_deep_links方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_nested_links
# 需要導入模塊: from autofixture.base import Link [as 別名]
# 或者: from autofixture.base.Link import get_deep_links [as 別名]
def test_nested_links(self):
link = Link(('foo', 'foo__bar', 'spam__ALL'))
self.assertTrue('foo' in link)
self.assertFalse('spam' in link)
self.assertFalse('egg' in link)
foolink = link.get_deep_links('foo')
self.assertTrue('bar' in foolink)
self.assertFalse('egg' in foolink)
spamlink = link.get_deep_links('spam')
self.assertTrue('bar' in spamlink)
self.assertTrue('egg' in spamlink)
示例2: test_always_true_link
# 需要導入模塊: from autofixture.base import Link [as 別名]
# 或者: from autofixture.base.Link import get_deep_links [as 別名]
def test_always_true_link(self):
link = Link(True)
self.assertTrue('field' in link)
self.assertTrue('any' in link)
link = link.get_deep_links('field')
self.assertTrue('field' in link)
self.assertTrue('any' in link)
link = Link(('ALL',))
self.assertTrue('field' in link)
self.assertTrue('any' in link)
link = link.get_deep_links('field')
self.assertTrue('field' in link)
self.assertTrue('any' in link)
示例3: test_links_with_value
# 需要導入模塊: from autofixture.base import Link [as 別名]
# 或者: from autofixture.base.Link import get_deep_links [as 別名]
def test_links_with_value(self):
link = Link({'foo': 1, 'spam__egg': 2}, default=0)
self.assertTrue('foo' in link)
self.assertEqual(link['foo'], 1)
self.assertFalse('spam' in link)
self.assertEqual(link['spam'], 0)
spamlink = link.get_deep_links('spam')
self.assertTrue('egg' in spamlink)
self.assertEqual(spamlink['bar'], 0)
self.assertEqual(spamlink['egg'], 2)
示例4: test_inherit_always_true_value
# 需要導入模塊: from autofixture.base import Link [as 別名]
# 或者: from autofixture.base.Link import get_deep_links [as 別名]
def test_inherit_always_true_value(self):
link = Link({'ALL': 1})
self.assertEqual(link['foo'], 1)
sublink = link.get_deep_links('foo')
self.assertEqual(sublink['bar'], 1)