def test_raises_value_error_if_repeat_delay_interval_max_higher_than_min( self): with pytest.raises(ValueError): Sound({"name": "Sound", "files": [], "repeat_delay": "42-24"}) sound = Sound({"name": "Sound", "files": [], "repeat_delay": "42"}) with pytest.raises(ValueError): sound.repeat_delay = "42-24"
def test_raises_value_error_if_repeat_delay_neither_int_nor_string_type( self): with pytest.raises(ValueError): Sound({"name": "Sound", "files": [], "repeat_delay": 5.6}) sound = Sound({"name": "Sound", "files": [], "repeat_delay": "42"}) with pytest.raises(ValueError): sound.repeat_delay = 12.5
def test_repeat_delay_single_int(self): sound = Sound({"name": "Sound", "files": [], "repeat_delay": 42}) assert sound._repeat_delay_min == 42 assert sound._repeat_delay_max == 42 assert sound.repeat_delay == 42 sound.repeat_delay = 24 assert sound._repeat_delay_min == 24 assert sound._repeat_delay_max == 24
def test_repeat_delay_interval(self): sound = Sound({"name": "Sound", "files": [], "repeat_delay": "24-42"}) assert sound._repeat_delay_min == 24 assert sound._repeat_delay_max == 42 repeat_delay_sample_value = sound.repeat_delay assert repeat_delay_sample_value >= 24 assert repeat_delay_sample_value <= 42 sound.repeat_delay = "25-43" assert sound._repeat_delay_min == 25 assert sound._repeat_delay_max == 43