openeventdata / phoenix_pipeline

Turning news into events since 2014.
MIT License
50 stars 33 forks source link

Add Mordecai docs and tests (closes #93) #98

Closed ahalterman closed 8 years ago

ahalterman commented 8 years ago

The unit tests only covers the query to the Mordecai service, not the larger pipeline, because as configured it has to hit the Mongo db again. We could break apart the mordecai function into a db calling function and an info bundling function, but I think the potential for messing things up there is greater than the benefit from having better tests.

ahalterman commented 8 years ago

Gross. Obviously this test is only going to work if Mordecai is running on Travis, which will require docker-compose and 20 minutes. @johnb30, worth it?

johnb30 commented 8 years ago

You'd want to build a mock of the object somehow. You're not wanting to actually test whether mordecai returns the right results. Instead you're testing if you can send a thing and then process the results in the proper manner. Something like this might help.

ahalterman commented 8 years ago

I'm merging now with just the minimal test and the documentation. Better test coverage will require a significant re-writing of the geolocation functions. See #99.