Skip to content

Commit e6e2d97

Browse files
committed
Add coverage for missing keys
1 parent f576126 commit e6e2d97

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

tests/integrations/launchdarkly/test_launchdarkly.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def test_launchdarkly_span_integration(
238238
with start_transaction(name="hi"):
239239
with start_span(op="foo", name="bar"):
240240
client.variation("hello", Context.create("my-org", "organization"), False)
241+
client.variation("other", Context.create("my-org", "organization"), False)
241242

242243
(event,) = events
243-
assert event["spans"][0]["data"] == ApproxDict({"flag.hello": True})
244+
assert event["spans"][0]["data"] == ApproxDict(
245+
{"flag.hello": True, "flag.other": False}
246+
)

tests/integrations/openfeature/test_openfeature.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ def test_openfeature_span_integration(
171171
with start_transaction(name="hi"):
172172
with start_span(op="foo", name="bar"):
173173
client.get_boolean_value("hello", default_value=False)
174+
client.get_boolean_value("world", default_value=False)
174175

175176
(event,) = events
176-
assert event["spans"][0]["data"] == ApproxDict({"flag.hello": True})
177+
assert event["spans"][0]["data"] == ApproxDict(
178+
{"flag.hello": True, "flag.world": False}
179+
)

tests/integrations/statsig/test_statsig.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,16 @@ def test_wrapper_attributes(sentry_init, uninstall_integration):
188188
def test_statsig_span_integration(sentry_init, capture_events, uninstall_integration):
189189
uninstall_integration(StatsigIntegration.identifier)
190190

191-
with mock_statsig({"hello": True, "world": False}):
191+
with mock_statsig({"hello": True}):
192192
sentry_init(traces_sample_rate=1, integrations=[StatsigIntegration()])
193193
events = capture_events()
194194
user = StatsigUser(user_id="user-id")
195195
with start_transaction(name="hi"):
196196
with start_span(op="foo", name="bar"):
197197
statsig.check_gate(user, "hello")
198+
statsig.check_gate(user, "world")
198199

199200
(event,) = events
200-
assert event["spans"][0]["data"] == ApproxDict({"flag.hello": True})
201+
assert event["spans"][0]["data"] == ApproxDict(
202+
{"flag.hello": True, "flag.world": False}
203+
)

tests/integrations/unleash/test_unleash.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ def test_unleash_span_integration(sentry_init, capture_events, uninstall_integra
178178
with start_transaction(name="hi"):
179179
with start_span(op="foo", name="bar"):
180180
client.is_enabled("hello")
181+
client.is_enabled("other")
181182

182183
(event,) = events
183-
assert event["spans"][0]["data"] == ApproxDict({"flag.hello": True})
184+
assert event["spans"][0]["data"] == ApproxDict(
185+
{"flag.hello": True, "flag.other": False}
186+
)

0 commit comments

Comments
 (0)