mozilla / active-data-recipes

A repository of various activedata queries and recipes
Mozilla Public License 2.0
8 stars 24 forks source link

Add a unittest for query.py #28

Closed ahal closed 5 years ago

ahal commented 6 years ago

We don't yet have a test for the query related functionality in adr. This test should cover functionality in the adr-query command. We'll want to create a test_query.py pytest test. It should test running queries with various formats, using different contexts, loading the query files themselves (and using JSON-e), and the various cli flags (--list, --verbose, etc).

The test will likely be pretty basic to start, but that's ok. We can add to it as time goes on.

Pytest documentation is here: https://docs.pytest.org/en/latest/contents.html

worldomonation commented 6 years ago

I would like to propose that this task is split into smaller subtasks, such as:

tests for:

ahal commented 6 years ago

Good idea. We can track it all in this issue, but encourage more minimal pull requests (as otherwise there will be conflicts).

Unit testing the methods in isolation sounds like the easiest piece on your bullet list, so just getting a test landed that accomplishes that would be a great start!

nikk15 commented 5 years ago

Hi @ahal! I'm an Outreachy applicant. After looking through the potential projects, this one seemed like the most interesting and the best learning curve for me personally. I appreciate the easy to comprehend communication in the project description and issue detailing.

I would love to gain experience testing in Python - would this be a good issue to tackle first? I could start with running mocked query data as mentioned above.

Looking forward to working on this project!

ahal commented 5 years ago

Hi @nikk15, so sorry I missed your comment.

Yes I think this bug would be a good one to get started. It's not super easy, but should be manageable. Please feel free to comment here, a PR or e-mail me if you need any extra help getting started!