def test_init_transition_blurs_when_over_threshold(mocker): args = Namespace(min=2, steps=10, blur=0, ignore=[]) blur = Blur(args) blur_thread = Transition(0, 0) unblur_thread = Transition(0, 0) mock_transition = mocker.patch('blurwal.blur.Transition') blur.init_transition(2, blur_thread, unblur_thread) mock_transition.assert_called_once_with(0, 10)
def test_init_transition_unblurs_when_under_threshold(mocker): args = Namespace(min=2, steps=10, blur=0, ignore=[]) blur = Blur(args) blur_thread = Transition(0, 0) blur_thread.current_level = 10 # Blur thread has completed unblur_thread = Transition(0, 0) mock_transition = mocker.patch('blurwal.blur.Transition') blur.init_transition(0, blur_thread, unblur_thread) mock_transition.assert_called_once_with(10, 0)
def test_init_transition_does_not_unblur_consecutively(mocker): mocker.patch('blurwal.wallpaper.change_to') args = Namespace(min=2, steps=10, blur=0, ignore=[]) blur = Blur(args) # Unblur as previous transition blur_thread, unblur_thread = blur.init_transition(0, Transition(0, 0), Transition(0, 0)) mock_transition = mocker.patch('blurwal.blur.Transition') # Should not unblur again consecutively blur.init_transition(0, blur_thread, unblur_thread) mock_transition.assert_not_called()