def test_intspansproduct_random_draw_constructible():
    r = IntspansProduct('3×4×6,7')
    d = r.random_draw(constructible=True)
    assert d == (3, 4, 6)
    d = r.random_draw(constructible=False)
    assert d == (3, 4, 7)
    r = IntspansProduct('3×4×7-10')
    with pytest.raises(RuntimeError) as excinfo:
        r.random_draw(constructible=True)
    assert str(excinfo.value) == 'Impossible to draw a constructible int '\
        "tuple from ['3', '4', '7-10'].\n"
    r = IntspansProduct('4-5×8×12')
    d = r.random_draw(constructible=True)
    assert d == (5, 8, 12)
    d = r.random_draw(constructible=False)
    assert d == (4, 8, 12)
    r = IntspansProduct('4×8-9×12-16')
    d = r.random_draw(constructible=True)
    assert d[0:2] == (4, 9)
    r = IntspansProduct('4×12-16×8-9')
    d = r.random_draw(constructible=True)
    assert d[0:2] == (4, 9)
    r = IntspansProduct('4×1-1002×1006-2006')
    with pytest.raises(RuntimeError) as excinfo:
        r.random_draw(constructible=True)
    assert str(excinfo.value) == 'Impossible to draw a constructible int '\
        "tuple from ['4', '1006-2006', '1-1002'].\n"
    r = IntspansProduct('4×4×4')
    d = r.random_draw(constructible=True)
    assert d == (4, 4, 4)
    r = IntspansProduct('3-5×3-5×3-5')
    with pytest.raises(RuntimeError) as excinfo:
        r.random_draw(constructible=False)
    assert str(excinfo.value) == 'Impossible to draw a not constructible int '\
        "tuple from ['3-5', '3-5', '3-5'].\n"
    r = IntspansProduct('5-6×3-5×3-5')
    d = r.random_draw(constructible=False)
    assert d == (3, 3, 6)
    r = IntspansProduct('2-7×5×4-5')
    with pytest.raises(RuntimeError) as excinfo:
        r.random_draw(constructible=False)
    assert str(excinfo.value) == 'Impossible to draw a not constructible int '\
        "tuple from ['5', '4-5', '2-7'].\n"