Пример #1
0
def run_example():
    order_elements = data_generator.generate_order_elements(6)
    order_1 = Order("Mac", "XYz", order_elements)
    print(order_1)
    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()
    order_1.add_product_to_order(product, quantity)
    print(order_1)
Пример #2
0
def run_homework():
    order_elements_on_limit = data_generator.generate_order_elements(
        products_to_generate=Order.MAX_ELEMENTS)
    order_on_limit = Order("Bob",
                           "Kowalski",
                           order_elements=order_elements_on_limit)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()
    order_on_limit.add_product_to_order(product, quantity)
Пример #3
0
def run_homework():
    order_elements = data_generator.generate_order_elements(Order.MAX_ELEMENTS)
    order_on_limit = Order("Mariusz", "Baran", order_elements)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()

    try:
        order_on_limit.add_product_to_order(product, quantity)
    except ElementsInOrderLimitError as error:
        print(f"{error}, dostępna ilość: {error.allowed_limit}")
Пример #4
0
def run_homework():
    order_elements_on_limit = data_generator.generate_order_elements(products_to_generate=Order.MAX_ELEMENTS)
    order_on_limit = Order("Bob", "Kowalski", order_elements=order_elements_on_limit)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()

    try:
        order_on_limit.add_product_to_order(product, quantity)
    except ElementsInOrderLimitError as error:
        print(f"Wystąpił błąd: {error}")
        print(f"Limit pozycji w zamówieniu wynosi: {error.allowed_limit}")
Пример #5
0
def run_homework():
    order_elements_on_limit = data_generator.generate_order_elements(
        products_to_generate=Order.MAX_ELEMENTS)
    order_on_limit = Order("Bob",
                           "Kowalski",
                           order_elements=order_elements_on_limit)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()

    try:
        order_on_limit.add_product_to_order(product, quantity)
    except ElementsInOrderLimitError:
        print("Nie można dodać już nic więcej!")
Пример #6
0
def run_example():
    order_elements = data_generator.generate_order_elements(number_of_products=Order.MAX_ORDER_ELEMENTS)
    order_1 = Order("Mac", "XYz", order_elements)
    print(order_1)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()

    try:
        order_1.add_product_to_order(product, quantity)
    except OrderElementsLimitError as error:
        print(f"Wystąpił błąd: >>{error}<<")
        print(f"Limit pozycji w zamówieniu wynosi: >>{error.places_limit}<<.")

    print(order_1)
Пример #7
0
def run_example():
    order_elements = data_generator.generate_order_elements(
        number_of_products=Order.MAX_ORDER_ELEMENTS)
    order_1 = Order("Mac", "XYz", order_elements)
    print(order_1)

    product = data_generator.generate_product()
    quantity = data_generator.generate_quantity()

    try:
        order_1.add_product_to_order(product, quantity)
    except OrderElementsLimitError as error:
        print(f"Przekroczono limit!!!. ENG: {error}.")

    print(order_1)