@pytest.mark.parametrize('status, expected', [(usertypes.LoadStatus.success, url.UrlType.success), (usertypes.LoadStatus.success_https, url.UrlType.success_https), (usertypes.LoadStatus.error, url.UrlType.error), (usertypes.LoadStatus.warn, url.UrlType.warn), (usertypes.LoadStatus.loading, url.UrlType.normal), (usertypes.LoadStatus.none, url.UrlType.normal)])
def test_on_load_status_changed(url_widget, status, expected):
 url_widget.set_url(QUrl('www.example.com'))
 url_widget.on_load_status_changed(status.name)
 assert (url_widget._urltype == expected)

@ pytest . mark . parametrize ( 'status, expected' , [ ( usertypes . LoadStatus . success , url . UrlType . success ) , ( usertypes . LoadStatus . success_https , url . UrlType . success_https ) , ( usertypes . LoadStatus . error , url . UrlType . error ) , ( usertypes . LoadStatus . warn , url . UrlType . warn ) , ( usertypes . LoadStatus . loading , url . UrlType . normal ) , ( usertypes . LoadStatus . none , url . UrlType . normal ) ] ) def test_on_load_status_changed ( url_widget , status , expected ) : url_widget . set_url ( QUrl ( 'www.example.com' ) ) url_widget . on_load_status_changed ( status . name ) assert ( url_widget . _urltype == expected )
test text when status is changed .