freelawproject / doctor

A microservice for document conversion at scale
https://free.law/projects/doctor
BSD 2-Clause "Simplified" License
54 stars 14 forks source link

164 Add x-ray microservice #165

Closed troglodite2 closed 1 year ago

troglodite2 commented 1 year ago

CL needs to be able to check PDFs for bad redactions. Rather than adding x-ray to CL we added a new microservice /utils/x-ray/pdf/ to do so

Two new unit tests were added which sends PDFs to be checked. The PDFs to check were pulled from the x-ray repo. The naming convention requires 'yes' for PDFs with bad redactions and "no" when they do not.

Fixes: #164

mlissner commented 1 year ago

Huh. Doctor tests don't seem to run automatically. Want to take a look at how CL or bots.law runs tests and add them to this PR?

troglodite2 commented 1 year ago
................{'mimetype': 'application/pdf'}
........
----------------------------------------------------------------------
Ran 25 tests in 13.160s

OK
root@80dcbb8b044a:/opt/app# python3 -m unittest doctor.tests
.Lame tag CRC check failed
................{'mimetype': 'application/pdf'}
........
----------------------------------------------------------------------
Ran 25 tests in 12.396s

OK
(python3.10) cjohnson@whiteboard:~/git/doctor$ docker-compose -f docker-compose.dev.yml up --build -d
Creating network "doctor_default" with the default driver
Building doctor
Sending build context to Docker daemon  40.98MB
...
-m unittest doctor.tests
.Lame tag CRC check failed
................{'mimetype': 'application/pdf'}
........
----------------------------------------------------------------------
Ran 25 tests in 13.485s

OK

I'm not sure what is happening. I ran the .github/workflow/{test,lint}.yml actions and they reported no errors.

mlissner commented 1 year ago

Thanks!