parent
3378f3ab8c
commit
cd2b9af902
@ -429,7 +429,7 @@ class TestCleaning(unittest.TestCase):
|
|||||||
'name': 'gif',
|
'name': 'gif',
|
||||||
'parser': images.GIFParser,
|
'parser': images.GIFParser,
|
||||||
'meta': {'Comment': 'this is a test comment'},
|
'meta': {'Comment': 'this is a test comment'},
|
||||||
'expected_meta': {},
|
'expected_meta': {'TransparentColor': '5'},
|
||||||
},{
|
},{
|
||||||
'name': 'css',
|
'name': 'css',
|
||||||
'parser': web.CSSParser,
|
'parser': web.CSSParser,
|
||||||
@ -531,9 +531,11 @@ class TestCleaning(unittest.TestCase):
|
|||||||
self.assertTrue(p1.remove_all())
|
self.assertTrue(p1.remove_all())
|
||||||
|
|
||||||
p2 = case['parser'](p1.output_filename)
|
p2 = case['parser'](p1.output_filename)
|
||||||
for k, v in p2.get_meta().items():
|
meta = p2.get_meta()
|
||||||
self.assertIn(k, case['expected_meta'])
|
if meta:
|
||||||
self.assertIn(str(case['expected_meta'][k]), str(v))
|
for k, v in p2.get_meta().items():
|
||||||
|
self.assertIn(k, case['expected_meta'], '"%s" is not in "%s" (%s)' % (k, case['expected_meta'], case['name']))
|
||||||
|
self.assertIn(str(case['expected_meta'][k]), str(v))
|
||||||
self.assertTrue(p2.remove_all())
|
self.assertTrue(p2.remove_all())
|
||||||
|
|
||||||
os.remove(target)
|
os.remove(target)
|
||||||
|
Loading…
Reference in New Issue
Block a user