##// END OF EJS Templates
Test case for setting only lower or upper, no sensible default so should be an error
Gordon Ball -
Show More
@@ -521,10 +521,10 b' def test_int_range_logic():'
521 with nt.assert_raises(ValueError):
521 with nt.assert_raises(ValueError):
522 w.upper = 1
522 w.upper = 1
523
523
524 w = irsw(lower=5, min=0, max=6)
524 w = irsw(min=2, max=3)
525 check_widget(w, lower=5)
525 check_widget(w, min=2, max=3)
526 w = irsw(upper=1, min=0, max=6)
526 w = irsw(min=100, max=200)
527 check_widget(w, upper=1)
527 check_widget(w, lower=125, upper=175, value=(125, 175))
528
528
529 with nt.assert_raises(ValueError):
529 with nt.assert_raises(ValueError):
530 irsw(value=(2, 4), lower=3)
530 irsw(value=(2, 4), lower=3)
@@ -534,6 +534,10 b' def test_int_range_logic():'
534 irsw(value=(2, 4), lower=3, upper=3)
534 irsw(value=(2, 4), lower=3, upper=3)
535 with nt.assert_raises(ValueError):
535 with nt.assert_raises(ValueError):
536 irsw(min=2, max=1)
536 irsw(min=2, max=1)
537 with nt.assert_raises(ValueError):
538 irsw(lower=5)
539 with nt.assert_raises(ValueError):
540 irsw(upper=5)
537
541
538
542
539 def test_float_range_logic():
543 def test_float_range_logic():
@@ -576,10 +580,10 b' def test_float_range_logic():'
576 with nt.assert_raises(ValueError):
580 with nt.assert_raises(ValueError):
577 w.upper = .1
581 w.upper = .1
578
582
579 w = frsw(lower=.5, min=0., max=.6)
583 w = frsw(min=2, max=3)
580 check_widget(w, lower=.5)
584 check_widget(w, min=2, max=3)
581 w = frsw(upper=.1, min=0., max=.6)
585 w = frsw(min=1., max=2.)
582 check_widget(w, upper=.1)
586 check_widget(w, lower=1.25, upper=1.75, value=(1.25, 1.75))
583
587
584 with nt.assert_raises(ValueError):
588 with nt.assert_raises(ValueError):
585 frsw(value=(2, 4), lower=3)
589 frsw(value=(2, 4), lower=3)
@@ -589,3 +593,7 b' def test_float_range_logic():'
589 frsw(value=(2, 4), lower=3, upper=3)
593 frsw(value=(2, 4), lower=3, upper=3)
590 with nt.assert_raises(ValueError):
594 with nt.assert_raises(ValueError):
591 frsw(min=.2, max=.1)
595 frsw(min=.2, max=.1)
596 with nt.assert_raises(ValueError):
597 frsw(lower=5)
598 with nt.assert_raises(ValueError):
599 frsw(upper=5)
General Comments 0
You need to be logged in to leave comments. Login now