frostfs-testlib/tests/test_dataclasses.py
Kirill Sosnovskikh dc5a9e7bb9 [#340] Move s3 and http directories to avoid conflict with requests
Signed-off-by: Kirill Sosnovskikh <k.sosnovskikh@yadro.com>
2024-12-18 12:57:24 +03:00

33 lines
1.2 KiB
Python

from typing import Any
import pytest
from frostfs_testlib.clients import AwsCliClient, Boto3ClientWrapper
from frostfs_testlib.storage.dataclasses.acl import EACLRole
from frostfs_testlib.storage.dataclasses.frostfs_services import HTTPGate, InnerRing, MorphChain, S3Gate, StorageNode
from frostfs_testlib.storage.dataclasses.object_size import ObjectSize
class TestDataclassesStr:
"""Here we are testing important classes string representation."""
@pytest.mark.parametrize(
"obj, expected",
[
(Boto3ClientWrapper, "Boto3 client"),
(AwsCliClient, "AWS CLI"),
(ObjectSize("simple", 1), "simple"),
(ObjectSize("simple", 10), "simple"),
(ObjectSize("complex", 5000), "complex"),
(ObjectSize("complex", 5555), "complex"),
(StorageNode, "StorageNode"),
(MorphChain, "MorphChain"),
(S3Gate, "S3Gate"),
(HTTPGate, "HTTPGate"),
(InnerRing, "InnerRing"),
(EACLRole.OTHERS, "OTHERS"),
],
)
def test_classes_string_representation(self, obj: Any, expected: str):
assert f"{obj}" == expected
assert repr(obj) == expected