本文整理汇总了Python中pystache.locator.Locator.find_object方法的典型用法代码示例。如果您正苦于以下问题:Python Locator.find_object方法的具体用法?Python Locator.find_object怎么用?Python Locator.find_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pystache.locator.Locator
的用法示例。
在下文中一共展示了Locator.find_object方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_find_object__none_file_name
# 需要导入模块: from pystache.locator import Locator [as 别名]
# 或者: from pystache.locator.Locator import find_object [as 别名]
def test_find_object__none_file_name(self):
locator = Locator()
obj = SayHello()
actual = locator.find_object(search_dirs=[], obj=obj)
expected = os.path.abspath(os.path.join(DATA_DIR, "say_hello.mustache"))
self.assertEquals(actual, expected)
示例2: test_find_object
# 需要导入模块: from pystache.locator import Locator [as 别名]
# 或者: from pystache.locator.Locator import find_object [as 别名]
def test_find_object(self):
locator = Locator()
obj = SayHello()
actual = locator.find_object(search_dirs=[], obj=obj, file_name='sample_view.mustache')
expected = os.path.join(DATA_DIR, 'sample_view.mustache')
self._assert_paths(actual, expected)
示例3: test_find_object__none_object_directory
# 需要导入模块: from pystache.locator import Locator [as 别名]
# 或者: from pystache.locator.Locator import find_object [as 别名]
def test_find_object__none_object_directory(self):
locator = Locator()
obj = None
self.assertEquals(None, locator.get_object_directory(obj))
actual = locator.find_object(search_dirs=[DATA_DIR], obj=obj, file_name="say_hello.mustache")
expected = os.path.join(DATA_DIR, "say_hello.mustache")
self.assertEquals(actual, expected)