# Path: mollie/api/objects/method.py
# class Method(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.methods import Methods
# 
#         return Methods(client)
# 
#     BANCONTACT = "bancontact"
#     BANKTRANSFER = "banktransfer"
#     BELFIUS = "belfius"
#     CREDITCARD = "creditcard"
#     DIRECTDEBIT = "directdebit"
#     EPS = "eps"
#     GIFTCARD = "giftcard"
#     GIROPAY = "giropay"
#     IDEAL = "ideal"
#     KBC = "kbc"
#     KLARNAPAYLATER = "klarnapaylater"
#     KLARNAPAYNOW = "klarnapaynow"
#     KLARNASLICEIT = "klarnasliceit"
#     MEALVOUCHER = "mealvoucher"
#     MISTERCASH = "mistercash"
#     MYBANK = "mybank"
#     PAYPAL = "paypal"
#     PAYSAFECARD = "paysafecard"
#     PODIUMCADEAUKAART = "podiumcadeaukaart"
#     PRZELEWY24 = "przelewy24"
#     SOFORT = "sofort"
# 
#     @property
#     def description(self):
#         return self._get_property("description")
# 
#     @property
#     def id(self):
#         return self._get_property("id")
# 
#     @property
#     def minimum_amount(self):
#         return self._get_property("minimumAmount")
# 
#     @property
#     def maximum_amount(self):
#         return self._get_property("maximumAmount")
# 
#     @property
#     def pricing(self):
#         return self._get_property("pricing")
# 
#     @property
#     def image_svg(self):
#         images = self._get_property("image")
#         return images["svg"]
# 
#     @property
#     def image_size1x(self):
#         images = self._get_property("image")
#         return images["size1x"]
# 
#     @property
#     def image_size2x(self):
#         images = self._get_property("image")
#         return images["size2x"]
# 
#     @property
#     def issuers(self):
#         """Return the list of available issuers for this payment method."""
#         issuers = self._get_property("issuers") or []
#         result = {
#             "_embedded": {
#                 "issuers": issuers,
#             },
#             "count": len(issuers),
#         }
#         return ObjectList(result, Issuer)
# 
# Path: tests/utils.py
# def assert_list_object(obj, object_type, count=None):
#     """Assert that a List object is correctly working, and has sane contents."""
#     assert isinstance(obj, ObjectList), f"Object {obj} is not a ObjectList instance."
#     assert isinstance(obj.count, int), "ObjectList count is not an integer."
#     if count is not None:
#         assert obj.count == count, "ObjectList does not contain the expected number of items."
#     else:
#         assert obj.count > 0, "ObjectList has no items."
# 
#     # verify items in list
#     items = []
#     for item in obj:
#         assert isinstance(item, object_type)
#         assert item.id is not None
#         items.append(item.id)
# 
#     assert len(items) == obj.count, "Items in ObjectList don't match list count."
#     assert len(set(items)) == obj.count, "Not all object ids in the ObjectList are unique."


from mollie.api.objects.method import Method
from .utils import assert_list_object



def test_list_methods(client, response):
    """Retrieve a list of available payment methods."""
    response.get("https://api.mollie.com/v2/methods", "methods_list")

    methods = client.methods.list()
    assert_list_object(methods, Method)


def test_method_get(client, response):
    """Retrieve a single payment method by ID."""
    response.get("https://api.mollie.com/v2/methods/ideal", "method_get_ideal")

    method = client.methods.get("ideal")

# Path: mollie/api/objects/method.py
# class Method(ObjectBase):
#     @classmethod
#     def get_resource_class(cls, client):
#         from ..resources.methods import Methods
# 
#         return Methods(client)
# 
#     BANCONTACT = "bancontact"
#     BANKTRANSFER = "banktransfer"
#     BELFIUS = "belfius"
#     CREDITCARD = "creditcard"
#     DIRECTDEBIT = "directdebit"
#     EPS = "eps"
#     GIFTCARD = "giftcard"
#     GIROPAY = "giropay"
#     IDEAL = "ideal"
#     KBC = "kbc"
#     KLARNAPAYLATER = "klarnapaylater"
#     KLARNAPAYNOW = "klarnapaynow"
#     KLARNASLICEIT = "klarnasliceit"
#     MEALVOUCHER = "mealvoucher"
#     MISTERCASH = "mistercash"
#     MYBANK = "mybank"
#     PAYPAL = "paypal"
#     PAYSAFECARD = "paysafecard"
#     PODIUMCADEAUKAART = "podiumcadeaukaart"
#     PRZELEWY24 = "przelewy24"
#     SOFORT = "sofort"
# 
#     @property
#     def description(self):
#         return self._get_property("description")
# 
#     @property
#     def id(self):
#         return self._get_property("id")
# 
#     @property
#     def minimum_amount(self):
#         return self._get_property("minimumAmount")
# 
#     @property
#     def maximum_amount(self):
#         return self._get_property("maximumAmount")
# 
#     @property
#     def pricing(self):
#         return self._get_property("pricing")
# 
#     @property
#     def image_svg(self):
#         images = self._get_property("image")
#         return images["svg"]
# 
#     @property
#     def image_size1x(self):
#         images = self._get_property("image")
#         return images["size1x"]
# 
#     @property
#     def image_size2x(self):
#         images = self._get_property("image")
#         return images["size2x"]
# 
#     @property
#     def issuers(self):
#         """Return the list of available issuers for this payment method."""
#         issuers = self._get_property("issuers") or []
#         result = {
#             "_embedded": {
#                 "issuers": issuers,
#             },
#             "count": len(issuers),
#         }
#         return ObjectList(result, Issuer)
# 
# Path: tests/utils.py
# def assert_list_object(obj, object_type, count=None):
#     """Assert that a List object is correctly working, and has sane contents."""
#     assert isinstance(obj, ObjectList), f"Object {obj} is not a ObjectList instance."
#     assert isinstance(obj.count, int), "ObjectList count is not an integer."
#     if count is not None:
#         assert obj.count == count, "ObjectList does not contain the expected number of items."
#     else:
#         assert obj.count > 0, "ObjectList has no items."
# 
#     # verify items in list
#     items = []
#     for item in obj:
#         assert isinstance(item, object_type)
#         assert item.id is not None
#         items.append(item.id)
# 
#     assert len(items) == obj.count, "Items in ObjectList don't match list count."
#     assert len(set(items)) == obj.count, "Not all object ids in the ObjectList are unique."


# Path: tests/test_methods.py
from mollie.api.objects.method import Method
from .utils import assert_list_object




def test_list_methods(client, response):
    """Retrieve a list of available payment methods."""
    response.get("https://api.mollie.com/v2/methods", "methods_list")

    methods = client.methods.list()
    assert_list_object(methods, Method)


def test_method_get(client, response):
    """Retrieve a single payment method by ID."""
    response.get("https://api.mollie.com/v2/methods/ideal", "method_get_ideal")

    method = client.methods.get("ideal")

    assert isinstance(method, Method)