import os
import unittest

from unittest.mock import MagicMock

from ingenico.connect.sdk.api_exception import ApiException
from ingenico.connect.sdk.call_context import CallContext
from ingenico.connect.sdk.communication_exception import CommunicationException
from ingenico.connect.sdk.connection import Connection
from ingenico.connect.sdk.declined_payment_exception import DeclinedPaymentException
from ingenico.connect.sdk.defaultimpl.authorization_type import AuthorizationType
from ingenico.connect.sdk.defaultimpl.default_authenticator import DefaultAuthenticator
from ingenico.connect.sdk.domain.definitions.address import Address
from ingenico.connect.sdk.domain.definitions.amount_of_money import AmountOfMoney
from ingenico.connect.sdk.domain.definitions.card import Card
from ingenico.connect.sdk.domain.payment.create_payment_request import CreatePaymentRequest
from ingenico.connect.sdk.domain.payment.definitions.card_payment_method_specific_input import \
    CardPaymentMethodSpecificInput
from ingenico.connect.sdk.domain.payment.definitions.customer import Customer
from ingenico.connect.sdk.domain.payment.definitions.order import Order
from ingenico.connect.sdk.factory import Factory
from ingenico.connect.sdk.idempotence_exception import IdempotenceException
from ingenico.connect.sdk.meta_data_provider import MetaDataProvider
from ingenico.connect.sdk.not_found_exception import NotFoundException
from ingenico.connect.sdk.reference_exception import ReferenceException
from ingenico.connect.sdk.response_exception import ResponseException
from ingenico.connect.sdk.session import Session
from ingenico.connect.sdk.validation_exception import ValidationException
from tests import file_utils


class PaymentsClientTest(unittest.TestCase):
    """Tests that a payment created in a merchant of a client result in appropriate POST requests being created"""

    def setUp(self):
        self.mock_connection = MagicMock(spec=Connection(), autospec=True)