import pytest
from pytest import mark, raises
from bottle import template

@mark.parametrize('expected, params', [
    ("""<div class="pure-u-1">
  <div class="l-box">
    <h3>Unit</h3>
  </div>
</div>
<div class="pure-u-1">

<select id="unit-select-one" name="unit" size="10"  style="width: calc(100% - 1em); margin: 0 1em 1em">


  <option value="Bags"  >Bags</option>
  <option value="Bunches"  >Bunches</option>
  <option value="L"  >L</option>
  <option value="Pieces"  >Pieces</option>
  <option value="g"  >g</option>
  <option value="kg"  selected="true">kg</option>
  <option value="mL"  >mL</option>
</select>
</div>""", {
    "name": "unit", "options": [{
        "value": "Bags",
    }, {
        "value": "Bunches",
    }, {
        "value": "L",
    }, {
        "value": "Pieces",
    }, {
        "value": "g",
    }, {
        "value": "kg",
        "selected": True,
    }, {
        "value": "mL",
    }, ]}, ),
])
def test_select_one_render_exact(expected, params):
    assert template('select-one', **params) == expected
