You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/05/01 17:41:56 UTC
[GitHub] [beam] BigJerBD commented on pull request #17455: [BEAM-13250] Factorise gcsio.GcsIO() from gcsfilesystem to allow overriding
BigJerBD commented on PR #17455:
URL: https://github.com/apache/beam/pull/17455#issuecomment-1114294629
This could be done to simplify some tests that patches on the module level
```python
# in sdks/python/apache_beam/io/gcp/gcsfilesystem_test.py
@mock.patch('apache_beam.io.gcp.gcsfilesystem.gcsio') # this could be removed
def test_create(self, mock_gcsio):
# Prepare mocks.
gcsio_mock = mock.MagicMock()
gcsfilesystem.gcsio.GcsIO = lambda: gcsio_mock # this would become: self.fs.get_gcsio = lambda: gcsio_mock
...
```
Would it be enough?
it might looks irrelevant but at the very least sdk users using those classes directly do not have to patch modules to override some gcsio.GcsIO properties if considered necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org