@pytest.mark.parametrize('progress, load_status, expected_visible', [(15, usertypes.LoadStatus.loading, True), (100, usertypes.LoadStatus.success, False), (100, usertypes.LoadStatus.error, False), (100, usertypes.LoadStatus.warn, False), (100, usertypes.LoadStatus.none, False)])
def test_tab_changed(fake_web_tab, progress_widget, progress, load_status, expected_visible):
 tab = fake_web_tab(progress=progress, load_status=load_status)
 progress_widget.on_tab_changed(tab)
 actual = (progress_widget.value(), progress_widget.isVisible())
 expected = (tab.progress(), expected_visible)
 assert (actual == expected)

@ pytest . mark . parametrize ( 'progress, load_status, expected_visible' , [ ( 15 , usertypes . LoadStatus . loading , True ) , ( 100 , usertypes . LoadStatus . success , False ) , ( 100 , usertypes . LoadStatus . error , False ) , ( 100 , usertypes . LoadStatus . warn , False ) , ( 100 , usertypes . LoadStatus . none , False ) ] ) def test_tab_changed ( fake_web_tab , progress_widget , progress , load_status , expected_visible ) : tab = fake_web_tab ( progress = progress , load_status = load_status ) progress_widget . on_tab_changed ( tab ) actual = ( progress_widget . value ( ) , progress_widget . isVisible ( ) ) expected = ( tab . progress ( ) , expected_visible ) assert ( actual == expected )
test that progress widget value and visibility state match expectations .