Skip to content

Commit

Permalink
[tests] Add test to ensure resources are rendered into HTML represent…
Browse files Browse the repository at this point in the history
…ations
  • Loading branch information
rspencer01 committed Jan 21, 2025
1 parent 52756bc commit df816a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/unit/block/test_base_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pybloqs.block.base as bbase
import pybloqs.config as config
import pybloqs.static as static


def test_publish_block():
Expand Down Expand Up @@ -86,3 +87,10 @@ def test_save_filename_and_extension(filename, fmt, exp_name, exp_fmt, exp_outpu
assert result == exp_name
if exp_fmt is not None:
assert result.split(".")[-1] == exp_fmt


def test_write_html_resources():
with patch.object(bbase.BaseBlock, "_write_contents"):
b = bbase.BaseBlock()
b.resource_deps = (static.Css(css_string="*{color:limegreen;}", name="dummy"),)
assert "limegreen" in b._repr_html_()

0 comments on commit df816a9

Please # to comment.