Skip to content

Commit

Permalink
build: fix mypy ignore comment
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Jan 16, 2024
1 parent fbfdd4a commit 8f10bf0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/files/tests/fs_s3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from scripts.files.fs_s3 import exists, read, write


@mock_s3
@mock_s3 # type: ignore
def test_write() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -23,7 +23,7 @@ def test_write() -> None:
assert resp["ContentType"] == "binary/octet-stream"


@mock_s3
@mock_s3 # type: ignore
def test_write_content_type() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -35,7 +35,7 @@ def test_write_content_type() -> None:
assert resp["ContentType"] == ContentType.GEOTIFF.value


@mock_s3
@mock_s3 # type: ignore
def test_read() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -47,7 +47,7 @@ def test_read() -> None:
assert content == b"test content"


@mock_s3
@mock_s3 # type: ignore
def test_read_bucket_not_found(capsys: CaptureFixture[str]) -> None:
with raises(ClientError):
read("s3://testbucket/test.file")
Expand All @@ -57,7 +57,7 @@ def test_read_bucket_not_found(capsys: CaptureFixture[str]) -> None:
assert logs["msg"] == "s3_bucket_not_found"


@mock_s3
@mock_s3 # type: ignore
def test_read_key_not_found(capsys: CaptureFixture[str]) -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
s3.create_bucket(Bucket="testbucket")
Expand All @@ -69,7 +69,7 @@ def test_read_key_not_found(capsys: CaptureFixture[str]) -> None:
assert logs["msg"] == "s3_key_not_found"


@mock_s3
@mock_s3 # type: ignore
def test_exists() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -81,7 +81,7 @@ def test_exists() -> None:
assert file_exists is True


@mock_s3
@mock_s3 # type: ignore
def test_directory_exists() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -93,7 +93,7 @@ def test_directory_exists() -> None:
assert directory_exists is True


@mock_s3
@mock_s3 # type: ignore
def test_exists_bucket_not_exists(capsys: CaptureFixture[str]) -> None:
file_exists = exists("s3://testbucket/test.file")

Expand All @@ -102,7 +102,7 @@ def test_exists_bucket_not_exists(capsys: CaptureFixture[str]) -> None:
assert file_exists is False


@mock_s3
@mock_s3 # type: ignore
def test_exists_object_not_exists() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand All @@ -114,7 +114,7 @@ def test_exists_object_not_exists() -> None:
assert file_exists is False


@mock_s3
@mock_s3 # type: ignore
def test_exists_object_starting_with_not_exists() -> None:
s3 = resource("s3", region_name=DEFAULT_REGION_NAME)
boto3_client = client("s3", region_name=DEFAULT_REGION_NAME)
Expand Down

0 comments on commit 8f10bf0

Please sign in to comment.