A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
more tests
jonaswinkler7e0aa7136aed
diff --git a/src/paperless_text/tests/samples/test.txt b/src/paperless_text/tests/samples/test.txtnew file mode 100644index 000000000..6de7b8c69--- /dev/null+++ b/src/paperless_text/tests/samples/test.txt@@ -0,0 +1 @@+This is a test file.diff --git a/src/paperless_text/tests/test_parser.py b/src/paperless_text/tests/test_parser.pynew file mode 100644index 000000000..413aa91cf--- /dev/null+++ b/src/paperless_text/tests/test_parser.py@@ -0,0 +1,26 @@+import os++from django.test import TestCase++from documents.tests.utils import DirectoriesMixin+from paperless_text.parsers import TextDocumentParser+++class TestTextParser(DirectoriesMixin, TestCase):++ def test_thumbnail(self):++ parser = TextDocumentParser(None)++ # just make sure that it does not crash+ f = parser.get_thumbnail(os.path.join(os.path.dirname(__file__), "samples", "test.txt"), "text/plain")+ self.assertTrue(os.path.isfile(f))++ def test_parse(self):++ parser = TextDocumentParser(None)++ parser.parse(os.path.join(os.path.dirname(__file__), "samples", "test.txt"), "text/plain")++ self.assertEqual(parser.get_text(), "This is a test file.\n")+ self.assertIsNone(parser.get_archive_path())