|
1 | 1 | # -*- coding: utf-8 -*-
|
2 | 2 | from .support import TestCase
|
| 3 | +from ingestors.exc import ENCRYPTED_MSG |
3 | 4 |
|
4 | 5 |
|
5 | 6 | class TabularIngestorTest(TestCase):
|
@@ -34,3 +35,21 @@ def test_unicode_ods(self):
|
34 | 35 | tables = [t.first("title") for t in tables]
|
35 | 36 | self.assertIn("Лист1", tables)
|
36 | 37 | self.assertEqual(entity.schema.name, "Workbook")
|
| 38 | + |
| 39 | + def test_password_protected_xlsx(self): |
| 40 | + fixture_path, entity = self.fixture("password_protected.xlsx") |
| 41 | + self.manager.ingest(fixture_path, entity) |
| 42 | + self.assertEqual(len(self.get_emitted()), 1) |
| 43 | + err = self.manager.entities[0].first("processingError") |
| 44 | + self.assertIn(ENCRYPTED_MSG, err) |
| 45 | + status = self.manager.entities[0].first("processingStatus") |
| 46 | + self.assertEqual("failure", status) |
| 47 | + |
| 48 | + def test_password_protected_xls(self): |
| 49 | + fixture_path, entity = self.fixture("password_protected.xls") |
| 50 | + self.manager.ingest(fixture_path, entity) |
| 51 | + self.assertEqual(len(self.get_emitted()), 1) |
| 52 | + err = self.manager.entities[0].first("processingError") |
| 53 | + self.assertIn(ENCRYPTED_MSG, err) |
| 54 | + status = self.manager.entities[0].first("processingStatus") |
| 55 | + self.assertEqual("failure", status) |
0 commit comments