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")
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")]
Пример #3
0
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")]
Пример #4
0
 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")