@pytest.mark.parametrize('url_text, expected', [('http://test.gr/%CE%B1%CE%B2%CE%B3%CE%B4.txt', 'http://test.gr/\xce\xb1\xce\xb2\xce\xb3\xce\xb4.txt'), ('http://test.ru/%D0%B0%D0%B1%D0%B2%D0%B3.txt', 'http://test.ru/\xd0\xb0\xd0\xb1\xd0\xb2\xd0\xb3.txt'), ('http://test.com/s%20p%20a%20c%20e.txt', 'http://test.com/s p a c e.txt'), ('http://test.com/%22quotes%22.html', 'http://test.com/%22quotes%22.html'), ('http://username:secret%20password@test.com', 'http://username@test.com'), ('http://example.com%5b/', 'http://example.com%5b/')])
def test_set_hover_url_encoded(url_widget, url_text, expected):
 url_widget.set_hover_url(url_text)
 assert (url_widget.text() == expected)
 assert (url_widget._urltype == url.UrlType.hover)

@ pytest . mark . parametrize ( 'url_text, expected' , [ ( 'http://test.gr/%CE%B1%CE%B2%CE%B3%CE%B4.txt' , 'http://test.gr/\xce\xb1\xce\xb2\xce\xb3\xce\xb4.txt' ) , ( 'http://test.ru/%D0%B0%D0%B1%D0%B2%D0%B3.txt' , 'http://test.ru/\xd0\xb0\xd0\xb1\xd0\xb2\xd0\xb3.txt' ) , ( 'http://test.com/s%20p%20a%20c%20e.txt' , 'http://test.com/s p a c e.txt' ) , ( 'http://test.com/%22quotes%22.html' , 'http://test.com/%22quotes%22.html' ) , ( 'http://username:secret%20password@test.com' , 'http://username@test.com' ) , ( 'http://example.com%5b/' , 'http://example.com%5b/' ) ] ) def test_set_hover_url_encoded ( url_widget , url_text , expected ) : url_widget . set_hover_url ( url_text ) assert ( url_widget . text ( ) == expected ) assert ( url_widget . _urltype == url . UrlType . hover )
test text when hovering over a percent encoded link .