Mercurial > public > sg101
comparison core/tests/test_html.py @ 985:9b197dbba34b
Fix image_check so it doesn't choke on empty input.
Issue #88.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 25 Oct 2015 13:54:56 -0500 |
parents | 4f265f61874b |
children |
comparison
equal
deleted
inserted
replaced
984:7167c489bcdd | 985:9b197dbba34b |
---|---|
64 url1 = 'https://xxx.example.com/1.jpg' | 64 url1 = 'https://xxx.example.com/1.jpg' |
65 url2 = 'https://yyy.example.com/2.jpg' | 65 url2 = 'https://yyy.example.com/2.jpg' |
66 html = TEST_HTML.format(src1=url1, src2=url2) | 66 html = TEST_HTML.format(src1=url1, src2=url2) |
67 | 67 |
68 self.assertRaises(ImageCheckError, image_check, html, self.allowed_hosts) | 68 self.assertRaises(ImageCheckError, image_check, html, self.allowed_hosts) |
69 | |
70 def test_empty_string(self): | |
71 result = image_check('') | |
72 self.assertTrue(result) | |
73 | |
74 def test_whitespace(self): | |
75 result = image_check('\r\n\r\n') | |
76 self.assertTrue(result) |