Beispiel #1
0
    def test_value_and_value_throttled(self) -> None:
        s0 = mws.RangeSlider(start=0, end=10)
        with pytest.raises(UnsetValueError):
            s0.value
        with pytest.raises(UnsetValueError):
            s0.value_throttled

        s1 = mws.RangeSlider(start=0, end=10, value=(4, 6))
        assert s1.value == (4, 6)
        assert s1.value_throttled == (4, 6)
def test_rangeslider_equal_start_end_validation(caplog):
    start = 0
    end = 10
    s = mws.RangeSlider(start=start, end=end)
    #with caplog.at_level(logging.ERROR, logger='bokeh.core.validation.check'):
    with caplog.at_level(logging.ERROR):
        assert len(caplog.records) == 0
        s.end = 0
        check_integrity([s])
        assert len(caplog.records) == 1
Beispiel #3
0
 def test_rangeslider_equal_start_end_validation(
         self, caplog: pytest.LogCaptureFixture) -> None:
     start = 0
     end = 10
     s = mws.RangeSlider(start=start, end=end)
     #with caplog.at_level(logging.ERROR, logger='bokeh.core.validation.check'):
     with caplog.at_level(logging.ERROR):
         assert len(caplog.records) == 0
         s.end = 0
         issues = check_integrity([s])
         process_validation_issues(issues)
         assert len(caplog.records) == 1
def test_rangeslider_equal_start_end_exception():
    start = 0
    end = 0
    with pytest.raises(ValueError):
        mws.RangeSlider(start=start, end=end)