mirror of
https://github.com/kanzure/pdfparanoia.git
synced 2025-07-04 20:37:38 +02:00
initial commit
This commit is contained in:
commit
d8fc6c1d8f
15 changed files with 380 additions and 0 deletions
27
tests/test_eraser.py
Normal file
27
tests/test_eraser.py
Normal 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)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue