当前位置: 首页>>代码示例>>Python>>正文


Python SCSS.compile_file方法代码示例

本文整理汇总了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")
开发者ID:tgiachi,项目名称:wi2m,代码行数:10,代码来源:test_scss.py

示例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"))
开发者ID:datanordic,项目名称:django-static-precompiler,代码行数:13,代码来源:test_scss.py

示例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"
    )
开发者ID:and3rson,项目名称:django-static-precompiler,代码行数:9,代码来源:test_scss.py

示例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"
    )
开发者ID:and3rson,项目名称:django-static-precompiler,代码行数:9,代码来源:test_scss.py

示例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"
        )
开发者ID:datanordic,项目名称:django-static-precompiler,代码行数:9,代码来源:test_scss.py

示例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"
        )
开发者ID:datanordic,项目名称:django-static-precompiler,代码行数:9,代码来源:test_scss.py


注:本文中的static_precompiler.compilers.SCSS.compile_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。