Loading remote_data_broker/brokers/filesys/broker.py +6 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,12 @@ class FilesysBroker(RemoteDataBroker): assert process.stdout is not None chunk = process.stdout.read(4096) if not chunk: process.wait() if process.returncode != 0: raise HTTPException( status_code=500, detail="cat file command returned error", ) break yield chunk Loading tests/integration/test_filesys_broker.py +10 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,16 @@ class TestFilesysBroker: async for chunk in res.body_iterator: response_body += chunk @pytest.mark.asyncio async def test_filesys_downloadfailnofile(self, _tear_up_down: Any) -> None: settings.rdb_cat_cmd = "cat" with pytest.raises(HTTPException): self.download_data.filename = "nonexist" res = self.broker.download(self.download_data) response_body = b"" async for chunk in res.body_iterator: response_body += chunk def test_filesys_delete(self, _tear_up_down: Any) -> None: self.broker.upload(self.upload_data) Loading Loading
remote_data_broker/brokers/filesys/broker.py +6 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,12 @@ class FilesysBroker(RemoteDataBroker): assert process.stdout is not None chunk = process.stdout.read(4096) if not chunk: process.wait() if process.returncode != 0: raise HTTPException( status_code=500, detail="cat file command returned error", ) break yield chunk Loading
tests/integration/test_filesys_broker.py +10 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,16 @@ class TestFilesysBroker: async for chunk in res.body_iterator: response_body += chunk @pytest.mark.asyncio async def test_filesys_downloadfailnofile(self, _tear_up_down: Any) -> None: settings.rdb_cat_cmd = "cat" with pytest.raises(HTTPException): self.download_data.filename = "nonexist" res = self.broker.download(self.download_data) response_body = b"" async for chunk in res.body_iterator: response_body += chunk def test_filesys_delete(self, _tear_up_down: Any) -> None: self.broker.upload(self.upload_data) Loading