ESJL / test_process_entry_occurrences.py
github-actions[bot]
Deploy ESJL 5f101220ffcb3a8cef4bb00d33cd8f96ebd5e79f
1fcc059
Raw History Blame Contribute Delete
1.06 kB
import unittest
from pathlib import Path
class ProcessEntryOccurrencesTest(unittest.TestCase):
def test_process_occurrence_combines_process_and_entry_date(self):
source = Path("app.js").read_text(encoding="utf-8")
self.assertIn("function processOccurrenceGroupKey(row)", source)
self.assertIn("normalizedProcessKey(processKey(row))", source)
self.assertIn("rowEntryOccurrenceKey(row)", source)
self.assertLess(
source.index('row.fields?.["Entrada Equipe"]', source.index("function rowEntryOccurrenceKey")),
source.index('row.fields?.["Entrada EAV"]', source.index("function rowEntryOccurrenceKey")),
)
def test_sheet_groups_and_metrics_use_occurrences(self):
source = Path("app.js").read_text(encoding="utf-8")
self.assertIn("const inscriptionsByOccurrence = new Map();", source)
self.assertIn("processes: inscriptionsByOccurrence.size", source)
self.assertIn("data-process-occurrence-key=", source)
if __name__ == "__main__":
unittest.main()