2023-07-24 16:34:21 +00:00
|
|
|
from typing import Any
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2024-12-17 15:16:54 +00:00
|
|
|
from frostfs_testlib.clients import AwsCliClient, Boto3ClientWrapper
|
2023-08-02 18:38:27 +00:00
|
|
|
from frostfs_testlib.storage.dataclasses.acl import EACLRole
|
2024-01-12 15:23:04 +00:00
|
|
|
from frostfs_testlib.storage.dataclasses.frostfs_services import HTTPGate, InnerRing, MorphChain, S3Gate, StorageNode
|
2023-07-24 16:34:21 +00:00
|
|
|
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"),
|
2024-01-12 15:23:04 +00:00
|
|
|
(ObjectSize("simple", 1), "simple"),
|
|
|
|
(ObjectSize("simple", 10), "simple"),
|
|
|
|
(ObjectSize("complex", 5000), "complex"),
|
|
|
|
(ObjectSize("complex", 5555), "complex"),
|
2023-07-24 16:34:21 +00:00
|
|
|
(StorageNode, "StorageNode"),
|
|
|
|
(MorphChain, "MorphChain"),
|
|
|
|
(S3Gate, "S3Gate"),
|
|
|
|
(HTTPGate, "HTTPGate"),
|
|
|
|
(InnerRing, "InnerRing"),
|
2023-08-02 18:38:27 +00:00
|
|
|
(EACLRole.OTHERS, "OTHERS"),
|
2023-07-24 16:34:21 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
def test_classes_string_representation(self, obj: Any, expected: str):
|
|
|
|
assert f"{obj}" == expected
|
|
|
|
assert repr(obj) == expected
|