1
0
Fork 0
mirror of https://github.com/kanzure/pdfparanoia.git synced 2025-07-04 20:37:38 +02:00

initial commit

This commit is contained in:
Bryan Bishop 2013-02-05 03:10:14 -06:00
commit d8fc6c1d8f
15 changed files with 380 additions and 0 deletions

27
tests/test_eraser.py Normal file
View file

@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
import unittest
from pdfparanoia.eraser import remove_object_by_id
class EraserTestCase(unittest.TestCase):
def test_remove_object_by_id(self):
content = ""
output = remove_object_by_id(content, 1)
self.assertEqual(content, output)
content = ""
output = remove_object_by_id(content, 2)
self.assertEqual(content, output)
content = ""
output = remove_object_by_id(content, 100)
self.assertEqual(content, output)
content = "1 0 obj\nthings\nendobj\nleftovers"
output = remove_object_by_id(content, 2)
self.assertEqual(content, output)
content = "1 0 obj\nthings\nendobj\nleftovers"
output = remove_object_by_id(content, 1)
self.assertEqual("leftovers", output)