本文整理汇总了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)