Example #1
0
 def test_subrecipe_outputs(self) -> None:
     assert render_cell(
         Cell(SubRecipe(Ingredient(SVS("spam")),
                        (SVS("foo"), SVS("bar"))))) == (
                            '<td class="rg-sub-recipe-outputs">\n'
                            '  <ul class="rg-sub-recipe-output-list">\n'
                            '    <li id="sub-recipe-foo">foo</li>\n'
                            '    <li id="sub-recipe-bar">bar</li>\n'
                            "  </ul>\n"
                            "</td>")
Example #2
0
 def test_edges(self) -> None:
     assert render_cell(
         Cell(
             Ingredient(SVS("spam")),
             border_top=BorderType.sub_recipe,
             border_left=BorderType.none,
             border_bottom=BorderType.sub_recipe,
             border_right=BorderType.none,
         ), ) == ('<td class="'
                  "rg-ingredient "
                  "rg-border-left-none "
                  "rg-border-right-none "
                  "rg-border-top-sub-recipe "
                  "rg-border-bottom-sub-recipe"
                  '">spam</td>')
Example #3
0
 def test_rowspan(self) -> None:
     assert (render_cell(
         Cell(
             Step(SVS("fry"), (Ingredient(SVS("spam")), )),
             rows=3,
         ), ) == '<td class="rg-step" rowspan="3">fry</td>')
Example #4
0
 def test_colspan(self) -> None:
     assert (render_cell(Cell(
         Ingredient(SVS("spam")),
         columns=3,
     ), ) == '<td class="rg-ingredient" colspan="3">spam</td>')
Example #5
0
 def test_subrecipe_header(self) -> None:
     assert (render_cell(
         Cell(SubRecipe(Ingredient(SVS("spam")), (SVS("foo"), )))) ==
             '<td class="rg-sub-recipe-header">foo</td>')
Example #6
0
 def test_step(self) -> None:
     assert (render_cell(Cell(Step(
         SVS("fry"),
         (Ingredient(SVS("spam")), )))) == '<td class="rg-step">fry</td>')
Example #7
0
 def test_reference(self) -> None:
     assert (render_cell(
         Cell(
             Reference(SubRecipe(Ingredient(SVS("spam")), (SVS("foo"), )),
                       0))
     ) == '<td class="rg-reference"><a href="#sub-recipe-foo">foo</a></td>')
Example #8
0
 def test_ingredient(self) -> None:
     assert (render_cell(Cell(Ingredient(
         SVS("spam")))) == '<td class="rg-ingredient">spam</td>')