本文整理汇总了Python中pipeline.compilers.Compiler.output_path方法的典型用法代码示例。如果您正苦于以下问题:Python Compiler.output_path方法的具体用法?Python Compiler.output_path怎么用?Python Compiler.output_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pipeline.compilers.Compiler
的用法示例。
在下文中一共展示了Compiler.output_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CompilerTest
# 需要导入模块: from pipeline.compilers import Compiler [as 别名]
# 或者: from pipeline.compilers.Compiler import output_path [as 别名]
class CompilerTest(TestCase):
def setUp(self):
default_collector.collect()
self.compiler = Compiler()
self.old_compilers = settings.PIPELINE_COMPILERS
settings.PIPELINE_COMPILERS = ['tests.tests.test_compiler.DummyCompiler']
def test_output_path(self):
output_path = self.compiler.output_path("js/helpers.coffee", "js")
self.assertEqual(output_path, "js/helpers.js")
def test_compilers_class(self):
compilers_class = self.compiler.compilers
self.assertEqual(compilers_class[0], DummyCompiler)
def test_compile(self):
paths = self.compiler.compile([
_('pipeline/js/dummy.coffee'),
_('pipeline/js/application.js'),
])
self.assertEqual([_('pipeline/js/dummy.js'), _('pipeline/js/application.js')], list(paths))
def tearDown(self):
default_collector.clear()
settings.PIPELINE_COMPILERS = self.old_compilers
示例2: CompilerStdoutTest
# 需要导入模块: from pipeline.compilers import Compiler [as 别名]
# 或者: from pipeline.compilers.Compiler import output_path [as 别名]
class CompilerStdoutTest(TestCase):
def setUp(self):
default_collector.collect()
self.compiler = Compiler()
def test_output_path(self):
output_path = self.compiler.output_path("js/helpers.coffee", "js")
self.assertEqual(output_path, "js/helpers.js")
def test_compile(self):
paths = self.compiler.compile([_('pipeline/js/dummy.coffee')])
self.assertEqual([_('pipeline/js/dummy.junk')], list(paths))
def tearDown(self):
default_collector.clear()
示例3: CompilerTest
# 需要导入模块: from pipeline.compilers import Compiler [as 别名]
# 或者: from pipeline.compilers.Compiler import output_path [as 别名]
class CompilerTest(TestCase):
def setUp(self):
self.compiler = Compiler()
self.old_compilers = settings.PIPELINE_COMPILERS
settings.PIPELINE_COMPILERS = ["tests.tests.test_compiler.DummyCompiler"]
def test_output_path(self):
output_path = self.compiler.output_path("js/helpers.coffee", "js")
self.assertEqual(output_path, "js/helpers.js")
def test_compilers_class(self):
compilers_class = self.compiler.compilers
self.assertEqual(compilers_class[0], DummyCompiler)
def test_compile(self):
paths = self.compiler.compile([_("pipeline/js/dummy.coffee"), _("pipeline/js/application.js")])
self.assertEqual([_("pipeline/js/dummy.js"), _("pipeline/js/application.js")], paths)
def tearDown(self):
settings.PIPELINE_COMPILERS = self.old_compilers