forked from testcontainers/testcontainers-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_minio.py
More file actions
21 lines (17 loc) · 683 Bytes
/
test_minio.py
File metadata and controls
21 lines (17 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import io
from testcontainers.minio import MinioContainer
def test_docker_run_minio():
config = MinioContainer(access_key="test-access", secret_key="test-secret")
with config as minio:
client = minio.get_client()
client.make_bucket("test")
test_content = b"Hello World"
client.put_object(
"test",
"testfile.txt",
io.BytesIO(test_content),
length=len(test_content),
)
assert client.get_object("test", "testfile.txt").data == test_content
assert minio.get_config()["access_key"] == config.access_key
assert minio.get_config()["secret_key"] == config.secret_key