本文整理匯總了Python中pystache.locator.Locator.make_file_name方法的典型用法代碼示例。如果您正苦於以下問題:Python Locator.make_file_name方法的具體用法?Python Locator.make_file_name怎麽用?Python Locator.make_file_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pystache.locator.Locator
的用法示例。
在下文中一共展示了Locator.make_file_name方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_make_file_name
# 需要導入模塊: from pystache.locator import Locator [as 別名]
# 或者: from pystache.locator.Locator import make_file_name [as 別名]
def test_make_file_name(self):
locator = Locator()
locator.template_extension = "bar"
self.assertEquals(locator.make_file_name("foo"), "foo.bar")
locator.template_extension = False
self.assertEquals(locator.make_file_name("foo"), "foo")
locator.template_extension = ""
self.assertEquals(locator.make_file_name("foo"), "foo.")
示例2: test_make_file_name
# 需要導入模塊: from pystache.locator import Locator [as 別名]
# 或者: from pystache.locator.Locator import make_file_name [as 別名]
def test_make_file_name(self):
locator = Locator()
locator.template_extension = 'bar'
self.assertEqual(locator.make_file_name('foo'), 'foo.bar')
locator.template_extension = False
self.assertEqual(locator.make_file_name('foo'), 'foo')
locator.template_extension = ''
self.assertEqual(locator.make_file_name('foo'), 'foo.')
示例3: test_make_file_name__template_extension_argument
# 需要導入模塊: from pystache.locator import Locator [as 別名]
# 或者: from pystache.locator.Locator import make_file_name [as 別名]
def test_make_file_name__template_extension_argument(self):
locator = Locator()
self.assertEquals(locator.make_file_name("foo", template_extension="bar"), "foo.bar")
示例4: test_make_file_name__template_extension_argument
# 需要導入模塊: from pystache.locator import Locator [as 別名]
# 或者: from pystache.locator.Locator import make_file_name [as 別名]
def test_make_file_name__template_extension_argument(self):
locator = Locator()
self.assertEqual(locator.make_file_name('foo', template_extension='bar'), 'foo.bar')