Skip to content

Commit 93cc2c4

Browse files
committed
test: Add test for get_baggage with DSN
1 parent 1476ff0 commit 93cc2c4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ def test_baggage_with_tracing_enabled(sentry_init):
9696
assert re.match(expected_baggage_re, get_baggage())
9797

9898

99+
def test_baggage_with_dsn(sentry_init):
100+
sentry_init(dsn="http://97333d956c9e40989a0139756c121c34@sentry-x.sentry-y.s.c.local/976543210", traces_sample_rate=1.0, release="2.0.0", environment="dev")
101+
with start_transaction() as transaction:
102+
expected_baggage_re = r"^sentry-trace_id={},sentry-sample_rand=0\.\d{{6}},sentry-environment=dev,sentry-release=2\.0\.0,sentry-sample_rate=1\.0,sentry-sampled={},sentry-public_key=97333d956c9e40989a0139756c121c34$".format(
103+
transaction.trace_id, "true" if transaction.sampled else "false"
104+
)
105+
print('xx received baggage', get_baggage() )
106+
assert re.match(expected_baggage_re, get_baggage())
107+
99108
def test_continue_trace(sentry_init):
100109
sentry_init()
101110

0 commit comments

Comments
 (0)