diff options
| author | jvoisin | 2019-02-27 23:04:38 +0100 |
|---|---|---|
| committer | jvoisin | 2019-02-27 23:04:38 +0100 |
| commit | 73d2966e8c10eb6c083a2abacc53f3297d16376e (patch) | |
| tree | 24830b2e95097f220379930e8c654ad073c04bc0 /tests/test_corrupted_files.py | |
| parent | eb2e702f3700a0ac88d10a524a5f6c573a52a8dd (diff) | |
Improve epub support
Diffstat (limited to 'tests/test_corrupted_files.py')
| -rw-r--r-- | tests/test_corrupted_files.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test_corrupted_files.py b/tests/test_corrupted_files.py index 53c856a..b2cec00 100644 --- a/tests/test_corrupted_files.py +++ b/tests/test_corrupted_files.py | |||
| @@ -253,13 +253,13 @@ class TestCorruptedFiles(unittest.TestCase): | |||
| 253 | os.remove('./tests/data/clean.cleaned.html') | 253 | os.remove('./tests/data/clean.cleaned.html') |
| 254 | 254 | ||
| 255 | with open('./tests/data/clean.html', 'w') as f: | 255 | with open('./tests/data/clean.html', 'w') as f: |
| 256 | f.write('</close>') | 256 | f.write('</meta>') |
| 257 | with self.assertRaises(ValueError): | 257 | with self.assertRaises(ValueError): |
| 258 | web.HTMLParser('./tests/data/clean.html') | 258 | web.HTMLParser('./tests/data/clean.html') |
| 259 | os.remove('./tests/data/clean.html') | 259 | os.remove('./tests/data/clean.html') |
| 260 | 260 | ||
| 261 | with open('./tests/data/clean.html', 'w') as f: | 261 | with open('./tests/data/clean.html', 'w') as f: |
| 262 | f.write('<notclosed>') | 262 | f.write('<meta><a>test</a><set/></meta><title></title><meta>') |
| 263 | p = web.HTMLParser('./tests/data/clean.html') | 263 | p = web.HTMLParser('./tests/data/clean.html') |
| 264 | with self.assertRaises(ValueError): | 264 | with self.assertRaises(ValueError): |
| 265 | p.get_meta() | 265 | p.get_meta() |
| @@ -269,6 +269,9 @@ class TestCorruptedFiles(unittest.TestCase): | |||
| 269 | os.remove('./tests/data/clean.html') | 269 | os.remove('./tests/data/clean.html') |
| 270 | 270 | ||
| 271 | with open('./tests/data/clean.html', 'w') as f: | 271 | with open('./tests/data/clean.html', 'w') as f: |
| 272 | f.write('<meta><meta/></meta>') | ||
| 273 | f.write('<title><title>pouet</title></title>') | ||
| 274 | f.write('<title><mysupertag/></title>') | ||
| 272 | f.write('<doctitle><br/></doctitle><br/><notclosed>') | 275 | f.write('<doctitle><br/></doctitle><br/><notclosed>') |
| 273 | p = web.HTMLParser('./tests/data/clean.html') | 276 | p = web.HTMLParser('./tests/data/clean.html') |
| 274 | with self.assertRaises(ValueError): | 277 | with self.assertRaises(ValueError): |
