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

LocalPath implementations and documentation for test mocking #107

Merged
merged 21 commits into from
Jan 27, 2021
Merged

Conversation

jayqi
Copy link
Member

@jayqi jayqi commented Nov 12, 2020

  • New abstract subclasses LocalPath and LocalClient that use the local filesystem as "cloud" storage.
  • New classes LocalAzureBlobClient, LocalAzureBlobPath, LocalS3Client, LocalS3Path that are intended to be monkeypatch substitutes for testing (UPDATE: +LocalGSClient, LocalGSPath)
  • New documentation article "Testing with cloudpathlib" "Testing code that uses cloudpathlib" with examples of how to patch things for tests
  • New test rigs that run the full test suite on the new local classes

Resolves #106

@jayqi jayqi changed the title [WIP] LocalPath implementations LocalPath implementations and documentation for test mocking Nov 14, 2020
@jayqi jayqi requested a review from pjbull November 14, 2020 22:51
@github-actions
Copy link
Contributor

github-actions bot commented Nov 15, 2020

@codecov
Copy link

codecov bot commented Nov 15, 2020

Codecov Report

Merging #107 (423f705) into master (da72bb3) will increase coverage by 0.0%.
The diff coverage is 91.9%.

@@           Coverage Diff           @@
##           master    #107    +/-   ##
=======================================
  Coverage    91.5%   91.5%            
=======================================
  Files          11      18     +7     
  Lines         839    1034   +195     
=======================================
+ Hits          768     947   +179     
- Misses         71      87    +16     
Impacted Files Coverage Δ
cloudpathlib/local/implementations/azure.py 84.8% <84.8%> (ø)
cloudpathlib/local/implementations/gs.py 86.6% <86.6%> (ø)
cloudpathlib/local/implementations/s3.py 86.6% <86.6%> (ø)
cloudpathlib/local/localpath.py 94.4% <94.4%> (ø)
cloudpathlib/local/localclient.py 97.3% <97.3%> (ø)
cloudpathlib/cloudpath.py 90.1% <100.0%> (ø)
cloudpathlib/local/__init__.py 100.0% <100.0%> (ø)
cloudpathlib/local/implementations/__init__.py 100.0% <100.0%> (ø)
cloudpathlib/s3/s3path.py 97.8% <100.0%> (ø)
... and 6 more

@jayqi
Copy link
Member Author

jayqi commented Nov 15, 2020

@pjbull I think this is ready for review!

@jayqi jayqi marked this pull request as ready for review November 15, 2020 03:21
cloudpathlib/cloudpath.py Outdated Show resolved Hide resolved
@jayqi
Copy link
Member Author

jayqi commented Jan 24, 2021

@pjbull I rebased this PR and added support for the new GS classes.

Copy link
Member

@pjbull pjbull left a comment

Choose a reason for hiding this comment

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

🎉

Would be good to add a bullet to "why cloudpathlib" at the top of the readme that says something like "Testability: We provide Local* classes that can be used to easily mock cloud storage in your unit tests."

cloudpathlib/cloudpath.py Outdated Show resolved Hide resolved
@jayqi jayqi merged commit 029dfd1 into master Jan 27, 2021
@pjbull pjbull deleted the localpath branch February 6, 2022 23:16
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.

Mocked CloudPath class(es)
2 participants