-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_processor.py
More file actions
22 lines (18 loc) · 875 Bytes
/
test_processor.py
File metadata and controls
22 lines (18 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import json
from dask.threaded import get
from processor import processor
import pytest
from ltldoorstep.encoders import json_dumps
def testing_city_finder():
path = os.path.join(os.path.dirname(__file__), 'sample_transcripts', 'out-example-2021-02-01-hansard-plenary.txt')
city_finder = processor()
workflow = city_finder.build_workflow(path)
report = get(workflow, 'output')
with open('./tests/test_report.json', 'r') as json_file:
expected_report = json.load(json_file)
compiled_report = report.compile()
# Once you have a working version of your processor, we recommend that you
# get the JSON output (python3 processor.py out...txt) and save it to tests/test_report.json
# Then uncomment the line below - this will alert you if your processor output ever changes!
# assert expected_report == compiled_report