Spaces:
Sleeping
Sleeping
Download test_priority_entry_comments.py from gui-sparim/ESJL: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/gui-sparim/ESJL/resolve/main/test_priority_entry_comments.py
- Command line
-
hf download hf://spaces/gui-sparim/ESJL/test_priority_entry_comments.py
-
curl -L -o test_priority_entry_comments.py https://huggingface.co/spaces/gui-sparim/ESJL/resolve/main/test_priority_entry_comments.py
1.43 kB
| import unittest | |
| from app import convert_entered_prioritization_observations | |
| class PriorityEntryCommentsTest(unittest.TestCase): | |
| def test_comment_targets_only_matching_entry(self): | |
| payload = { | |
| 'rows': [ | |
| {'rowNumber': 1, 'fields': {'Processo SEI': '25.0.000001111-1', 'Entrada EAV': '2026-05-01'}, 'comments': []}, | |
| {'rowNumber': 2, 'fields': {'Processo SEI': '25.0.000001111-1', 'Entrada EAV': '2026-08-01'}, 'comments': []}, | |
| ], | |
| 'prioritizationRequests': [{'id': 'august', 'process': '25.0.000001111-1', 'entryDate': '2026-08-01', 'description': 'Pedido de agosto'}], | |
| } | |
| convert_entered_prioritization_observations(payload) | |
| self.assertEqual(payload['rows'][0]['comments'], []) | |
| self.assertEqual(len(payload['rows'][1]['comments']), 1) | |
| payload['prioritizationRequests'][0]['description'] = 'Comentário editado' | |
| convert_entered_prioritization_observations(payload) | |
| self.assertEqual(len(payload['rows'][1]['comments']), 1) | |
| self.assertIn('Comentário editado', payload['rows'][1]['comments'][0]['text']) | |
| payload['prioritizationRequests'].append({'id': 'future', 'process': '25.0.000001111-1', 'entryDate': '2026-09-01', 'description': 'Ainda externo'}) | |
| convert_entered_prioritization_observations(payload) | |
| self.assertEqual(len(payload['rows'][1]['comments']), 1) | |