# Path: roulier/roulier.py
# class RoulierFactory(object):
#     def __init__(self):
#     def register_builder(self, carrier_type, action, Carrierclass):
#     def get(self, carrier_type, action, **kwargs):
# def get(carrier_type, action, *args, **kwargs):
# def get_carriers_action_available():
# 
# Path: roulier/exception.py
# class InvalidApiInput(Exception):
#     """Bad input.
# 
#     Use this class in your application to manage
#     exception with api call
#     """
# 
# class CarrierError(Exception):
#     """Error from WS.
# 
#     Use this class in your application to manage
#     exception with the carrier WS
#     """
# 
#     def __init__(self, response, msg=None):
#         if msg is None:
#             msg = "An error occured with WS"
#         super(CarrierError, self).__init__(msg)
#         self.response = response
#         if self.response:
#             if hasattr(self.response, "text"):
#                 log.debug(response.text)
#             else:
#                 log.debug(response)
# 
# Path: roulier/carriers/laposte_fr/tests/data.py
# DATA = {
#     "auth": {
#         "login": credentials["login"],
#         "password": credentials["password"],
#         "isTest": credentials["isTest"],
#     },
#     "service": {"shippingDate": date.today()},
#     "parcels": [{"weight": 1.2, "instructions": "Fake instructions"}],
#     "to_address": {
#         "name": "Fr",
#         "firstName": "Hpar",
#         "street1": "27 rue Léon CAMET",
#         "city": "Villeurbanne",
#         "country": "FR",
#         "zip": "69100",
#     },
#     "from_address": {
#         "name": "TEST",
#         "firstName": "AUTOMATIC",
#         "street1": "72 rue Cécile Honxa",
#         "city": "Paris",
#         "country": "FR",
#         "zip": "75001",
#     },
# }
# 
# Path: roulier/carriers/laposte_fr/tests/test_laposte_basic.py
# def _do_not_execute_test_on_remote():
#     """Test execution require valid credentials
#     which are not included in commited files.
# 
#     Main tests are only executable in local installation.
#     This method when called allow to escape remote tests
#     """
#     if DATA["auth"]["password"] == "blablabla":
#         return True
#     return False
# 
# Path: roulier/carriers/laposte_fr/tests/test_laposte_basic.py
# def assert_label(result):
#     assert "parcels" in result
#     assert len(result["parcels"]) > 0
#     assert "label" in result["parcels"][0]
#     assert "data" in result["parcels"][0]["label"]
#     return result["parcels"][0]["label"]


import logging
import copy
from roulier import roulier
from roulier.exception import InvalidApiInput, CarrierError
from .data import DATA
from .test_laposte_basic import _do_not_execute_test_on_remote
from .test_laposte_basic import assert_label
        "importersReference": "",
        "importersContact": "",
        "officeOrigin": "",
        "comments": "comments",
        "description": "Fake description",
        "invoiceNumber": "111141111",
        "licenceNumber": "",
        "certificatNumber": "",
        "importerAddress": {
            "company": "company name",
            "lastName": "Lastname",
            "firstName": "Firstname",
            "line0": "line0",
            "line1": "line1",
            "line2": "line2",
            "line3": "line3",
            "country": "FR",
            "city": "city",
            "zip": "75007",
            "phone": "+12089145766",
            "mobile": "0600000007",
            "door1": "",
            "door2": "",
            "email": "email@email.fr",
            "intercom": "intercom",
            "language": "FR",
        },
    }
    vals["parcels"][0]["totalAmount"] = 123  # Frais de transport
    result = roulier.get("laposte_fr", "get_label", vals)

# Path: roulier/roulier.py
# class RoulierFactory(object):
#     def __init__(self):
#     def register_builder(self, carrier_type, action, Carrierclass):
#     def get(self, carrier_type, action, **kwargs):
# def get(carrier_type, action, *args, **kwargs):
# def get_carriers_action_available():
# 
# Path: roulier/exception.py
# class InvalidApiInput(Exception):
#     """Bad input.
# 
#     Use this class in your application to manage
#     exception with api call
#     """
# 
# class CarrierError(Exception):
#     """Error from WS.
# 
#     Use this class in your application to manage
#     exception with the carrier WS
#     """
# 
#     def __init__(self, response, msg=None):
#         if msg is None:
#             msg = "An error occured with WS"
#         super(CarrierError, self).__init__(msg)
#         self.response = response
#         if self.response:
#             if hasattr(self.response, "text"):
#                 log.debug(response.text)
#             else:
#                 log.debug(response)
# 
# Path: roulier/carriers/laposte_fr/tests/data.py
# DATA = {
#     "auth": {
#         "login": credentials["login"],
#         "password": credentials["password"],
#         "isTest": credentials["isTest"],
#     },
#     "service": {"shippingDate": date.today()},
#     "parcels": [{"weight": 1.2, "instructions": "Fake instructions"}],
#     "to_address": {
#         "name": "Fr",
#         "firstName": "Hpar",
#         "street1": "27 rue Léon CAMET",
#         "city": "Villeurbanne",
#         "country": "FR",
#         "zip": "69100",
#     },
#     "from_address": {
#         "name": "TEST",
#         "firstName": "AUTOMATIC",
#         "street1": "72 rue Cécile Honxa",
#         "city": "Paris",
#         "country": "FR",
#         "zip": "75001",
#     },
# }
# 
# Path: roulier/carriers/laposte_fr/tests/test_laposte_basic.py
# def _do_not_execute_test_on_remote():
#     """Test execution require valid credentials
#     which are not included in commited files.
# 
#     Main tests are only executable in local installation.
#     This method when called allow to escape remote tests
#     """
#     if DATA["auth"]["password"] == "blablabla":
#         return True
#     return False
# 
# Path: roulier/carriers/laposte_fr/tests/test_laposte_basic.py
# def assert_label(result):
#     assert "parcels" in result
#     assert len(result["parcels"]) > 0
#     assert "label" in result["parcels"][0]
#     assert "data" in result["parcels"][0]["label"]
#     return result["parcels"][0]["label"]


# Path: roulier/carriers/laposte_fr/tests/test_laposte_outside_europe.py
import logging
import copy
from roulier import roulier
from roulier.exception import InvalidApiInput, CarrierError
from .data import DATA
from .test_laposte_basic import _do_not_execute_test_on_remote
from .test_laposte_basic import assert_label

        "importersReference": "",
        "importersContact": "",
        "officeOrigin": "",
        "comments": "comments",
        "description": "Fake description",
        "invoiceNumber": "111141111",
        "licenceNumber": "",
        "certificatNumber": "",
        "importerAddress": {
            "company": "company name",
            "lastName": "Lastname",
            "firstName": "Firstname",
            "line0": "line0",
            "line1": "line1",
            "line2": "line2",
            "line3": "line3",
            "country": "FR",
            "city": "city",
            "zip": "75007",
            "phone": "+12089145766",
            "mobile": "0600000007",
            "door1": "",
            "door2": "",
            "email": "email@email.fr",
            "intercom": "intercom",
            "language": "FR",
        },
    }
    vals["parcels"][0]["totalAmount"] = 123  # Frais de transport
    result = roulier.get("laposte_fr", "get_label", vals)

    label = assert_label(result)