Fix lint.

This commit is contained in:
Florian Bruhin 2015-08-01 13:47:42 +02:00
parent fa131e3290
commit 52d7a5693f
2 changed files with 4 additions and 3 deletions

View File

@ -346,7 +346,8 @@ class NetworkManager(QNetworkAccessManager):
# Note: using ''.encode('ascii') sends a header with no value,
# instead of no header at all
req.setRawHeader('Referer'.encode('ascii'), QByteArray())
elif (referer_header_conf== 'same-domain' and current_url.isValid() and
elif (referer_header_conf == 'same-domain' and
current_url.isValid() and
not urlutils.same_domain(req.url(), current_url)):
req.setRawHeader('Referer'.encode('ascii'), QByteArray())
# If refer_header_conf is set to 'always', we leave the header alone as

View File

@ -512,7 +512,7 @@ def test_fuzzy_url_error(url, raising, has_err_string):
(False, 'http://one.not_a_valid_tld', 'http://two.not_a_valid_tld'),
])
def test_same_domain(are_same, url1, url2):
"""Tests for same_domain."""
"""Test same_domain."""
assert urlutils.same_domain(QUrl(url1), QUrl(url2)) == are_same
assert urlutils.same_domain(QUrl(url2), QUrl(url1)) == are_same
@ -521,6 +521,6 @@ def test_same_domain(are_same, url1, url2):
('', 'http://example.com'),
])
def test_same_domain_invalid_url(url1, url2):
"""Tests with invalid URLs for same_domain."""
"""Test same_domain with invalid URLs."""
with pytest.raises(ValueError):
urlutils.same_domain(QUrl(url1), QUrl(url2))