Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

100% coverage for oauth2client.contrib.multistore_file #492

Merged
merged 1 commit into from
Apr 8, 2016

Conversation

theacodes
Copy link
Contributor

No description provided.

with mock.patch.object(multistore_file.logger, 'warn') as mock_warn:
multistore._warn_on_readonly = False
multistore._lock()
self.assertFalse(mock_warn.called)

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Apr 8, 2016

LGTM other than nit about cleaning up the os file resources

@dhermes
Copy link
Contributor

dhermes commented Apr 8, 2016

We have a context manager for making temp files: https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/_testing.py

Can't remember why we need it, something Windows related I think. But could be useful here

@theacodes theacodes force-pushed the multistore-file-coverage branch from f68a62d to 2f72420 Compare April 8, 2016 21:19
@theacodes
Copy link
Contributor Author

I just re-used their top-level file which has cleanup logic in setup and teardown. I'll consider the context managers when I re-write.

This makes me miss py.test, which has proper fixtures.

@theacodes theacodes merged commit 991595c into googleapis:master Apr 8, 2016
@theacodes theacodes deleted the multistore-file-coverage branch April 8, 2016 21:21
@dhermes
Copy link
Contributor

dhermes commented Apr 8, 2016

Very tricky!

@dhermes
Copy link
Contributor

dhermes commented Apr 8, 2016

Alright @waprin let's cross that finish line!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants