Created
October 1, 2023 07:03
-
-
Save DBC-Works/04804063f46acece3eaea368be2456f0 to your computer and use it in GitHub Desktop.
Test class template using moto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from moto import mock_s3 | |
import pytest | |
class TestClassTemplateUsingMoto: | |
@classmethod | |
def setup_class(cls): | |
cls.__mock_s3 = mock_s3() | |
cls.__mock_s3.start() | |
s3_resource = boto3.resource("s3") | |
s3_resource.create_bucket(Bucket="test-bucket") | |
@classmethod | |
def teardown_class(cls): | |
cls.__mock_s3.stop() | |
def test_with_s3_mock(self): | |
# arrange | |
# act | |
# assert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment