本文整理匯總了Python中static_precompiler.compilers.LESS.postprocess方法的典型用法代碼示例。如果您正苦於以下問題:Python LESS.postprocess方法的具體用法?Python LESS.postprocess怎麽用?Python LESS.postprocess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類static_precompiler.compilers.LESS
的用法示例。
在下文中一共展示了LESS.postprocess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_postprocesss
# 需要導入模塊: from static_precompiler.compilers import LESS [as 別名]
# 或者: from static_precompiler.compilers.LESS import postprocess [as 別名]
def test_postprocesss(monkeypatch):
compiler = LESS()
convert_urls = call_recorder(lambda *args: "spam")
monkeypatch.setattr("static_precompiler.compilers.less.convert_urls", convert_urls)
assert compiler.postprocess("ham", "eggs") == "spam"
assert convert_urls.calls == [call("ham", "eggs")]
示例2: test_postprocesss
# 需要導入模塊: from static_precompiler.compilers import LESS [as 別名]
# 或者: from static_precompiler.compilers.LESS import postprocess [as 別名]
def test_postprocesss(self):
compiler = LESS()
with patch("static_precompiler.compilers.less.convert_urls") as mocked_convert_urls:
mocked_convert_urls.return_value = "spam"
self.assertEqual(compiler.postprocess("ham", "eggs"), "spam")
mocked_convert_urls.assert_called_with("ham", "eggs")