def METHOD_NAME(card_number: str, brand: PaymentCardBrand, valid: bool):
    # pcn = PCN(card_number, brand)
    if valid:
        assert PaymentCardNumber.validate_brand(card_number) == brand
    else:
        with pytest.raises(PydanticCustomError) as exc_info:
            PaymentCardNumber.validate_brand(card_number)
        assert exc_info.value.type == 'payment_card_number_brand'