Skip to content

Commit

Permalink
fix: simplify assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
md384 committed Dec 6, 2023
1 parent c868892 commit 78c8795
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/integrations/redis/cluster/test_redis_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ def test_rediscluster_breadcrumb(sentry_init, capture_events):

# on initializing a RedisCluster, a COMMAND call is made - this is not important for the test
# but must be accounted for
assert len(crumbs) <= 2
if len(crumbs) == 2:
assert event["breadcrumbs"]["values"][0]["message"] == "COMMAND"
assert len(crumbs) in (1, 2)
assert len(crumbs) == 1 or crumbs[0]["message"] == "COMMAND"

crumb = event["breadcrumbs"]["values"][-1]
crumb = crumbs[-1]

assert crumb == {
"category": "redis",
Expand Down Expand Up @@ -77,11 +76,10 @@ def test_rediscluster_basic(sentry_init, capture_events, send_default_pii, descr

# on initializing a RedisCluster, a COMMAND call is made - this is not important for the test
# but must be accounted for
assert len(spans) <= 2
if len(spans) == 2:
assert event["spans"][0]["description"] == "COMMAND"
assert len(spans) in (1, 2)
assert len(spans) == 1 or spans[0]["description"] == "COMMAND"

span = event["spans"][-1]
span = spans[-1]
assert span["op"] == "db.redis"
assert span["description"] == description
assert span["data"] == {
Expand Down

0 comments on commit 78c8795

Please sign in to comment.