Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/subscriptions/test/test_updateMalwareDomainsList.py

Issue 29821558: Issue #6707 - Make the generated malware domain filter list encode domains as Punycode (Closed)
Patch Set: Updated encoding format Created July 6, 2018, 11:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/subscriptions/test/test_updateMalwareDomainsList.py
diff --git a/sitescripts/subscriptions/test/test_updateMalwareDomainsList.py b/sitescripts/subscriptions/test/test_updateMalwareDomainsList.py
index bd1dd2521aba2c12f550d3dc965c67a78b150386..ea15b4e269945526a42a34168d583533db446832 100644
--- a/sitescripts/subscriptions/test/test_updateMalwareDomainsList.py
+++ b/sitescripts/subscriptions/test/test_updateMalwareDomainsList.py
@@ -58,7 +58,8 @@ def urlopen(mocker):
if url.startswith('good'):
zf_data = io.BytesIO()
with zipfile.ZipFile(zf_data, 'w') as zf:
- zf.writestr('justdomains', 'success\n')
+ idna_urls = ['xn--xhq02ykwbp4a.cn', 'xn--fiq80yua78t.tw']
+ zf.writestr('justdomains', '\n'.join(idna_urls) + '\n')
return io.BytesIO(zf_data.getvalue())
if url.startswith('bad'):
raise urllib2.HTTPError('Bad', '42', 'No good', [], None)
@@ -73,7 +74,9 @@ def test_good(md_repo):
main()
subprocess.check_call(['hg', 'up'], cwd=md_repo.strpath)
result = md_repo.join('malwaredomains_full.txt').read()
- assert 'success' in result
+ puny_urls = ['xn--xhq02ykwbp4a.cn', 'xn--fiq80yua78t.tw']
+ for url in puny_urls:
+ assert url in result
def test_bad(md_repo, config):

Powered by Google App Engine
This is Rietveld