Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mibi consumer updated #115

Closed
wants to merge 41 commits into from
Closed

Mibi consumer updated #115

wants to merge 41 commits into from

Conversation

cdpavelchek
Copy link
Contributor

Mibi consumer and mibi consumer tests

Copy link
Contributor

@willgraf willgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good for the most part, just a few comments. Generally, it looks like we're doing a lot of check on the shape, type, etc. that I think are a little confusing. If they're necessary let's test them.

redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/settings.py Outdated Show resolved Hide resolved
redis_consumer/consumers/base_consumer.py Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
redis_consumer/consumers/mibi_consumer.py Outdated Show resolved Hide resolved
@willgraf
Copy link
Contributor

willgraf commented Jul 6, 2020

I've made some updates to the testing patterns. I recommend pulling in the master branch and adapting your tests to use the redis_client test fixture instead of the DummyRedis class.

The new tests are much more robust and easier to write.

@willgraf
Copy link
Contributor

willgraf commented Jul 8, 2020

We should also refactor MibiConsumer to MultiplexConsumer or something like that. The consumer should be more general than just MIBI.

willgraf and others added 9 commits July 10, 2020 14:54
* Improved testing coverage using fakeredis and pytest-mock (#117)

* install pytest-mock and replace monkeypatching with `mock` library.

* move testing reqs into requirements-test.txt and add 3.8 to test suite.

* update RedisClient tests to use fakeredis.

* directly patch boto3.client

* no need to alias google.cloud.storage in imports.

* Fix storage tests to use a Singleton dummy class instead of global variables.

* proper string fomatting using {} instead of %s

* move DummyStorage and DummyRedis into utils/testing_utils.py to DRY out the tests

* Update tests to use fakeredis client and fewer global variables.

* use save_output for ImageConsumer and MibiConsumer.

pass save_name into the function directly instead of calling HGETALL inside the save_output function.

* inherit from ImageFileConsumer to make better use of the pre/post-process functions.

* add keys for the mibi pre and postprocessing.

* adapt the mibi consumer tests to use the testing_utils.py helpers.

* remove unused imports.

* Fix a few license URLs. (#118)
@willgraf willgraf closed this Jul 16, 2020
@willgraf willgraf deleted the mibi-consumer-updated branch July 16, 2020 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants