"""Matchers module.""" class StartsWith: """Match that string starts with a prefix.""" def __init__(self, prefix: str) -> None: self.prefix = prefix def __eq__(self, other: object) -> bool: return isinstance(other, str) and other.startswith(self.prefix) def __repr__(self) -> str: return f'StartsWith({self.prefix!r})' class EndsWith: """Match that string ends with a prefix.""" def __init__(self, prefix: str) -> None: self.prefix = prefix def __eq__(self, other: object) -> bool: return isinstance(other, str) and other.endswith(self.prefix) def __repr__(self) -> str: return f'EndsWith({self.prefix!r})'