Skip to content

Commit

Permalink
Refactoring: Addressing various pylint/isort/flake8 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lmilbaum committed Sep 1, 2020
1 parent b9c3154 commit a014dab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pytest

import mock


@pytest.fixture(autouse=True)
def mock_s3_client():
with mock.patch("aioboto3.client") as mock_client:
s3_client = mock.AsyncMock()
s3_client.__aenter__.return_value = s3_client
mock_client.return_value = s3_client
yield s3_client
19 changes: 5 additions & 14 deletions tests/s3/test_manage_mpu.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
import mock
import pytest
import textwrap

from fastapi import HTTPException
import pytest

from exodus_gw.s3.api import multipart_upload, abort_multipart_upload, upload
import mock
from exodus_gw.s3.api import abort_multipart_upload, multipart_upload
from exodus_gw.s3.util import xml_response
from fastapi import HTTPException

TEST_KEY = "b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c"


@pytest.fixture(autouse=True)
def mock_s3_client():
with mock.patch("aioboto3.client") as mock_client:
s3_client = mock.AsyncMock()
s3_client.__aenter__.return_value = s3_client
mock_client.return_value = s3_client
yield s3_client


@pytest.mark.asyncio
async def test_create_mpu(mock_s3_client):
"""Creating a multipart upload is delegated correctly to S3."""
Expand Down Expand Up @@ -126,7 +117,7 @@ async def test_complete_mpu(mock_s3_client):


@pytest.mark.asyncio
async def test_bad_mpu_call(mock_s3_client):
async def test_bad_mpu_call():
"""Mixing uploadId and uploads arguments gives a validation error."""

with pytest.raises(HTTPException) as exc_info:
Expand Down

0 comments on commit a014dab

Please sign in to comment.