本文整理汇总了Python中static_precompiler.compilers.SCSS.compile_file方法的典型用法代码示例。如果您正苦于以下问题:Python SCSS.compile_file方法的具体用法?Python SCSS.compile_file怎么用?Python SCSS.compile_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类static_precompiler.compilers.SCSS
的用法示例。
在下文中一共展示了SCSS.compile_file方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_compass_import
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compass_import():
compiler = SCSS(compass_enabled=True)
assert fix_line_breaks(compiler.compile_file("styles/test-compass-import.scss")) == ".round-corners {\n -moz-border-radius: 4px / 4px;\n -webkit-border-radius: 4px 4px;\n border-radius: 4px / 4px; }\n"
compiler = SCSS(compass_enabled=False)
with pytest.raises(StaticCompilationError):
compiler.compile_file("styles/test-compass-import.scss")
示例2: test_compass_import
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compass_import(self):
compiler = SCSS()
with patch.object(compiler, "compass_enabled", return_value=True):
self.assertEqual(
fix_line_breaks(compiler.compile_file("styles/test-compass-import.scss")),
".round-corners {\n -webkit-border-radius: 4px 4px;\n -moz-border-radius: 4px / 4px;\n border-radius: 4px / 4px; }\n"
)
with patch.object(compiler, "compass_enabled", return_value=False):
self.assertRaises(StaticCompilationError, lambda: compiler.compile_file("styles/test-compass-import.scss"))
示例3: test_compile_file
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compile_file():
compiler = SCSS()
assert (
fix_line_breaks(compiler.compile_file("styles/test.scss")) ==
"p {\n font-size: 15px; }\n p a {\n color: red; }\n"
)
示例4: test_compass
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compass():
compiler = SCSS(compass_enabled=True)
assert (
fix_line_breaks(compiler.compile_file("test-compass.scss")) ==
"p {\n background: url('/static/images/test.png'); }\n"
)
示例5: test_compile_file
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compile_file(self):
compiler = SCSS()
self.assertEqual(
fix_line_breaks(compiler.compile_file("styles/test.scss")),
"p {\n font-size: 15px; }\n p a {\n color: red; }\n"
)
示例6: test_compass
# 需要导入模块: from static_precompiler.compilers import SCSS [as 别名]
# 或者: from static_precompiler.compilers.SCSS import compile_file [as 别名]
def test_compass(self):
compiler = SCSS()
self.assertEqual(
fix_line_breaks(compiler.compile_file("test-compass.scss")),
"p {\n background: url('/static/images/test.png'); }\n"
)