Skip to content

Commit 08f4e3d

Browse files
committed
test wrapper attributes
1 parent 0e638b9 commit 08f4e3d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/integrations/unleash/test_unleash.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from sentry_sdk.integrations.unleash import UnleashIntegration
55
from tests.integrations.unleash import MockUnleashClient
66

7+
original_is_enabled = MockUnleashClient.is_enabled
8+
original_get_variant = MockUnleashClient.get_variant
9+
710

811
@patch("sentry_sdk.integrations.unleash.UnleashClient", MockUnleashClient)
912
def test_is_enabled(sentry_init, capture_events, reset_integration):
@@ -51,3 +54,21 @@ def test_get_variant(sentry_init, capture_events, reset_integration):
5154
{"flag": "unknown_feature", "result": False},
5255
]
5356
}
57+
58+
59+
def test_wrapper_attributes(sentry_init, reset_integration):
60+
reset_integration(UnleashIntegration.identifier)
61+
sentry_init(integrations=[UnleashIntegration()])
62+
63+
client = MockUnleashClient()
64+
assert client.is_enabled.__name__ == "is_enabled"
65+
assert client.is_enabled.__qualname__ == original_is_enabled.__qualname__
66+
assert MockUnleashClient.is_enabled.__name__ == "is_enabled"
67+
assert MockUnleashClient.is_enabled.__qualname__ == original_is_enabled.__qualname__
68+
69+
assert client.get_variant.__name__ == "get_variant"
70+
assert client.get_variant.__qualname__ == original_get_variant.__qualname__
71+
assert MockUnleashClient.get_variant.__name__ == "get_variant"
72+
assert (
73+
MockUnleashClient.get_variant.__qualname__ == original_get_variant.__qualname__
74+
)

0 commit comments

Comments
 (0)