Skip to content

Commit

Permalink
bug-1906108: switch to markus AnyTagValue
Browse files Browse the repository at this point in the history
  • Loading branch information
willkg committed Aug 10, 2024
1 parent ce596ae commit e04b56e
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions tests/test_breakpad_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from unittest.mock import ANY

from everett.manager import ConfigManager
from markus.testing import AnyTagValue
import pytest

from antenna.breakpad_resource import (
Expand All @@ -19,34 +20,6 @@
from testlib.mini_poster import compress, multipart_encode


class AnyTagValue:
"""Matches a markus metrics tag with any value"""

def __init__(self, key):
self.key = key

def __repr__(self):
return f"<AnyTagValue {self.key}>"

def get_other_key(self, other):
# This is comparing against a tag string
if ":" in other:
other_key, _ = other.split(":")
else:
other_key = other
return other_key

def __eq__(self, other):
if isinstance(other, AnyTagValue):
return self.key == other.key
return self.key == self.get_other_key(other)

def __lt__(self, other):
if isinstance(other, AnyTagValue):
return self.key < other.key
return self.key < self.get_other_key(other)


class FakeCrashMover:
"""Fake crash mover that raises an error when used"""

Expand Down

0 comments on commit e04b56e

Please sign in to comment.