本文整理匯總了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)