bb-integrations-library 3.0.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bb_integrations_lib/__init__.py +0 -0
- bb_integrations_lib/converters/__init__.py +0 -0
- bb_integrations_lib/gravitate/__init__.py +0 -0
- bb_integrations_lib/gravitate/base_api.py +20 -0
- bb_integrations_lib/gravitate/model.py +29 -0
- bb_integrations_lib/gravitate/pe_api.py +122 -0
- bb_integrations_lib/gravitate/rita_api.py +552 -0
- bb_integrations_lib/gravitate/sd_api.py +572 -0
- bb_integrations_lib/gravitate/testing/TTE/sd/models.py +1398 -0
- bb_integrations_lib/gravitate/testing/TTE/sd/tests/test_models.py +2987 -0
- bb_integrations_lib/gravitate/testing/__init__.py +0 -0
- bb_integrations_lib/gravitate/testing/builder.py +55 -0
- bb_integrations_lib/gravitate/testing/openapi.py +70 -0
- bb_integrations_lib/gravitate/testing/util.py +274 -0
- bb_integrations_lib/mappers/__init__.py +0 -0
- bb_integrations_lib/mappers/prices/__init__.py +0 -0
- bb_integrations_lib/mappers/prices/model.py +106 -0
- bb_integrations_lib/mappers/prices/price_mapper.py +127 -0
- bb_integrations_lib/mappers/prices/protocol.py +20 -0
- bb_integrations_lib/mappers/prices/util.py +61 -0
- bb_integrations_lib/mappers/rita_mapper.py +523 -0
- bb_integrations_lib/models/__init__.py +0 -0
- bb_integrations_lib/models/dtn_supplier_invoice.py +487 -0
- bb_integrations_lib/models/enums.py +28 -0
- bb_integrations_lib/models/pipeline_structs.py +76 -0
- bb_integrations_lib/models/probe/probe_event.py +20 -0
- bb_integrations_lib/models/probe/request_data.py +431 -0
- bb_integrations_lib/models/probe/resume_token.py +7 -0
- bb_integrations_lib/models/rita/audit.py +113 -0
- bb_integrations_lib/models/rita/auth.py +30 -0
- bb_integrations_lib/models/rita/bucket.py +17 -0
- bb_integrations_lib/models/rita/config.py +188 -0
- bb_integrations_lib/models/rita/constants.py +19 -0
- bb_integrations_lib/models/rita/crossroads_entities.py +293 -0
- bb_integrations_lib/models/rita/crossroads_mapping.py +428 -0
- bb_integrations_lib/models/rita/crossroads_monitoring.py +78 -0
- bb_integrations_lib/models/rita/crossroads_network.py +41 -0
- bb_integrations_lib/models/rita/crossroads_rules.py +80 -0
- bb_integrations_lib/models/rita/email.py +39 -0
- bb_integrations_lib/models/rita/issue.py +63 -0
- bb_integrations_lib/models/rita/mapping.py +227 -0
- bb_integrations_lib/models/rita/probe.py +58 -0
- bb_integrations_lib/models/rita/reference_data.py +110 -0
- bb_integrations_lib/models/rita/source_system.py +9 -0
- bb_integrations_lib/models/rita/workers.py +76 -0
- bb_integrations_lib/models/sd/bols_and_drops.py +241 -0
- bb_integrations_lib/models/sd/get_order.py +301 -0
- bb_integrations_lib/models/sd/orders.py +18 -0
- bb_integrations_lib/models/sd_api.py +115 -0
- bb_integrations_lib/pipelines/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/distribution_report/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/distribution_report/order_by_site_product_parser.py +50 -0
- bb_integrations_lib/pipelines/parsers/distribution_report/tank_configs_parser.py +47 -0
- bb_integrations_lib/pipelines/parsers/dtn/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/dtn/dtn_price_parser.py +102 -0
- bb_integrations_lib/pipelines/parsers/dtn/model.py +79 -0
- bb_integrations_lib/pipelines/parsers/price_engine/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/price_engine/parse_accessorials_prices_parser.py +67 -0
- bb_integrations_lib/pipelines/parsers/price_engine/price_file_upload/__init__.py +0 -0
- bb_integrations_lib/pipelines/parsers/price_engine/price_file_upload/price_merge_parser.py +111 -0
- bb_integrations_lib/pipelines/parsers/price_engine/price_file_upload/price_sync_parser.py +107 -0
- bb_integrations_lib/pipelines/parsers/price_engine/price_file_upload/shared.py +81 -0
- bb_integrations_lib/pipelines/parsers/tank_reading_parser.py +155 -0
- bb_integrations_lib/pipelines/parsers/tank_sales_parser.py +144 -0
- bb_integrations_lib/pipelines/shared/__init__.py +0 -0
- bb_integrations_lib/pipelines/shared/allocation_matching.py +227 -0
- bb_integrations_lib/pipelines/shared/bol_allocation.py +2793 -0
- bb_integrations_lib/pipelines/steps/__init__.py +0 -0
- bb_integrations_lib/pipelines/steps/create_accessorials_step.py +80 -0
- bb_integrations_lib/pipelines/steps/distribution_report/__init__.py +0 -0
- bb_integrations_lib/pipelines/steps/distribution_report/distribution_report_datafram_to_raw_data.py +33 -0
- bb_integrations_lib/pipelines/steps/distribution_report/get_model_history_step.py +50 -0
- bb_integrations_lib/pipelines/steps/distribution_report/get_order_by_site_product_step.py +62 -0
- bb_integrations_lib/pipelines/steps/distribution_report/get_tank_configs_step.py +40 -0
- bb_integrations_lib/pipelines/steps/distribution_report/join_distribution_order_dos_step.py +85 -0
- bb_integrations_lib/pipelines/steps/distribution_report/upload_distribution_report_datafram_to_big_query.py +47 -0
- bb_integrations_lib/pipelines/steps/echo_step.py +14 -0
- bb_integrations_lib/pipelines/steps/export_dataframe_to_rawdata_step.py +28 -0
- bb_integrations_lib/pipelines/steps/exporting/__init__.py +0 -0
- bb_integrations_lib/pipelines/steps/exporting/bbd_export_payroll_file_step.py +107 -0
- bb_integrations_lib/pipelines/steps/exporting/bbd_export_readings_step.py +236 -0
- bb_integrations_lib/pipelines/steps/exporting/cargas_wholesale_bundle_upload_step.py +33 -0
- bb_integrations_lib/pipelines/steps/exporting/dataframe_flat_file_export.py +29 -0
- bb_integrations_lib/pipelines/steps/exporting/gcs_bucket_export_file_step.py +34 -0
- bb_integrations_lib/pipelines/steps/exporting/keyvu_export_step.py +356 -0
- bb_integrations_lib/pipelines/steps/exporting/pe_price_export_step.py +238 -0
- bb_integrations_lib/pipelines/steps/exporting/platform_science_order_sync_step.py +500 -0
- bb_integrations_lib/pipelines/steps/exporting/save_rawdata_to_disk.py +15 -0
- bb_integrations_lib/pipelines/steps/exporting/sftp_export_file_step.py +60 -0
- bb_integrations_lib/pipelines/steps/exporting/sftp_export_many_files_step.py +23 -0
- bb_integrations_lib/pipelines/steps/exporting/update_exported_orders_table_step.py +64 -0
- bb_integrations_lib/pipelines/steps/filter_step.py +22 -0
- bb_integrations_lib/pipelines/steps/get_latest_sync_date.py +34 -0
- bb_integrations_lib/pipelines/steps/importing/bbd_import_payroll_step.py +30 -0
- bb_integrations_lib/pipelines/steps/importing/get_order_numbers_to_export_step.py +138 -0
- bb_integrations_lib/pipelines/steps/importing/load_file_to_dataframe_step.py +46 -0
- bb_integrations_lib/pipelines/steps/importing/load_imap_attachment_step.py +172 -0
- bb_integrations_lib/pipelines/steps/importing/pe_bulk_sync_price_structure_step.py +68 -0
- bb_integrations_lib/pipelines/steps/importing/pe_price_merge_step.py +86 -0
- bb_integrations_lib/pipelines/steps/importing/sftp_file_config_step.py +124 -0
- bb_integrations_lib/pipelines/steps/importing/test_exact_file_match.py +57 -0
- bb_integrations_lib/pipelines/steps/null_step.py +15 -0
- bb_integrations_lib/pipelines/steps/pe_integration_job_step.py +32 -0
- bb_integrations_lib/pipelines/steps/processing/__init__.py +0 -0
- bb_integrations_lib/pipelines/steps/processing/archive_gcs_step.py +76 -0
- bb_integrations_lib/pipelines/steps/processing/archive_sftp_step.py +48 -0
- bb_integrations_lib/pipelines/steps/processing/bbd_format_tank_readings_step.py +492 -0
- bb_integrations_lib/pipelines/steps/processing/bbd_upload_prices_step.py +54 -0
- bb_integrations_lib/pipelines/steps/processing/bbd_upload_tank_sales_step.py +124 -0
- bb_integrations_lib/pipelines/steps/processing/bbd_upload_tankreading_step.py +80 -0
- bb_integrations_lib/pipelines/steps/processing/convert_bbd_order_to_cargas_step.py +226 -0
- bb_integrations_lib/pipelines/steps/processing/delete_sftp_step.py +33 -0
- bb_integrations_lib/pipelines/steps/processing/dtn/__init__.py +2 -0
- bb_integrations_lib/pipelines/steps/processing/dtn/convert_dtn_invoice_to_sd_model.py +145 -0
- bb_integrations_lib/pipelines/steps/processing/dtn/parse_dtn_invoice_step.py +38 -0
- bb_integrations_lib/pipelines/steps/processing/file_config_parser_step.py +720 -0
- bb_integrations_lib/pipelines/steps/processing/file_config_parser_step_v2.py +418 -0
- bb_integrations_lib/pipelines/steps/processing/get_sd_price_price_request.py +105 -0
- bb_integrations_lib/pipelines/steps/processing/keyvu_upload_deliveryplan_step.py +39 -0
- bb_integrations_lib/pipelines/steps/processing/mark_orders_exported_in_bbd_step.py +185 -0
- bb_integrations_lib/pipelines/steps/processing/pe_price_rows_processing_step.py +174 -0
- bb_integrations_lib/pipelines/steps/processing/send_process_report_step.py +47 -0
- bb_integrations_lib/pipelines/steps/processing/sftp_renamer_step.py +61 -0
- bb_integrations_lib/pipelines/steps/processing/tank_reading_touchup_steps.py +75 -0
- bb_integrations_lib/pipelines/steps/processing/upload_supplier_invoice_step.py +16 -0
- bb_integrations_lib/pipelines/steps/send_attached_in_rita_email_step.py +44 -0
- bb_integrations_lib/pipelines/steps/send_rita_email_step.py +34 -0
- bb_integrations_lib/pipelines/steps/sleep_step.py +24 -0
- bb_integrations_lib/pipelines/wrappers/__init__.py +0 -0
- bb_integrations_lib/pipelines/wrappers/accessorials_transformation.py +104 -0
- bb_integrations_lib/pipelines/wrappers/distribution_report.py +191 -0
- bb_integrations_lib/pipelines/wrappers/export_tank_readings.py +237 -0
- bb_integrations_lib/pipelines/wrappers/import_tank_readings.py +192 -0
- bb_integrations_lib/pipelines/wrappers/wrapper.py +81 -0
- bb_integrations_lib/protocols/__init__.py +0 -0
- bb_integrations_lib/protocols/flat_file.py +210 -0
- bb_integrations_lib/protocols/gravitate_client.py +104 -0
- bb_integrations_lib/protocols/pipelines.py +697 -0
- bb_integrations_lib/provider/__init__.py +0 -0
- bb_integrations_lib/provider/api/__init__.py +0 -0
- bb_integrations_lib/provider/api/cargas/__init__.py +0 -0
- bb_integrations_lib/provider/api/cargas/client.py +43 -0
- bb_integrations_lib/provider/api/cargas/model.py +49 -0
- bb_integrations_lib/provider/api/cargas/protocol.py +23 -0
- bb_integrations_lib/provider/api/dtn/__init__.py +0 -0
- bb_integrations_lib/provider/api/dtn/client.py +128 -0
- bb_integrations_lib/provider/api/dtn/protocol.py +9 -0
- bb_integrations_lib/provider/api/keyvu/__init__.py +0 -0
- bb_integrations_lib/provider/api/keyvu/client.py +30 -0
- bb_integrations_lib/provider/api/keyvu/model.py +149 -0
- bb_integrations_lib/provider/api/macropoint/__init__.py +0 -0
- bb_integrations_lib/provider/api/macropoint/client.py +28 -0
- bb_integrations_lib/provider/api/macropoint/model.py +40 -0
- bb_integrations_lib/provider/api/pc_miler/__init__.py +0 -0
- bb_integrations_lib/provider/api/pc_miler/client.py +130 -0
- bb_integrations_lib/provider/api/pc_miler/model.py +6 -0
- bb_integrations_lib/provider/api/pc_miler/web_services_apis.py +131 -0
- bb_integrations_lib/provider/api/platform_science/__init__.py +0 -0
- bb_integrations_lib/provider/api/platform_science/client.py +147 -0
- bb_integrations_lib/provider/api/platform_science/model.py +82 -0
- bb_integrations_lib/provider/api/quicktrip/__init__.py +0 -0
- bb_integrations_lib/provider/api/quicktrip/client.py +52 -0
- bb_integrations_lib/provider/api/telapoint/__init__.py +0 -0
- bb_integrations_lib/provider/api/telapoint/client.py +68 -0
- bb_integrations_lib/provider/api/telapoint/model.py +178 -0
- bb_integrations_lib/provider/api/warren_rogers/__init__.py +0 -0
- bb_integrations_lib/provider/api/warren_rogers/client.py +207 -0
- bb_integrations_lib/provider/aws/__init__.py +0 -0
- bb_integrations_lib/provider/aws/s3/__init__.py +0 -0
- bb_integrations_lib/provider/aws/s3/client.py +126 -0
- bb_integrations_lib/provider/ftp/__init__.py +0 -0
- bb_integrations_lib/provider/ftp/client.py +140 -0
- bb_integrations_lib/provider/ftp/interface.py +273 -0
- bb_integrations_lib/provider/ftp/model.py +76 -0
- bb_integrations_lib/provider/imap/__init__.py +0 -0
- bb_integrations_lib/provider/imap/client.py +228 -0
- bb_integrations_lib/provider/imap/model.py +3 -0
- bb_integrations_lib/provider/sqlserver/__init__.py +0 -0
- bb_integrations_lib/provider/sqlserver/client.py +106 -0
- bb_integrations_lib/secrets/__init__.py +4 -0
- bb_integrations_lib/secrets/adapters.py +98 -0
- bb_integrations_lib/secrets/credential_models.py +222 -0
- bb_integrations_lib/secrets/factory.py +85 -0
- bb_integrations_lib/secrets/providers.py +160 -0
- bb_integrations_lib/shared/__init__.py +0 -0
- bb_integrations_lib/shared/exceptions.py +25 -0
- bb_integrations_lib/shared/model.py +1039 -0
- bb_integrations_lib/shared/shared_enums.py +510 -0
- bb_integrations_lib/storage/README.md +236 -0
- bb_integrations_lib/storage/__init__.py +0 -0
- bb_integrations_lib/storage/aws/__init__.py +0 -0
- bb_integrations_lib/storage/aws/s3.py +8 -0
- bb_integrations_lib/storage/defaults.py +72 -0
- bb_integrations_lib/storage/gcs/__init__.py +0 -0
- bb_integrations_lib/storage/gcs/client.py +8 -0
- bb_integrations_lib/storage/gcsmanager/__init__.py +0 -0
- bb_integrations_lib/storage/gcsmanager/client.py +8 -0
- bb_integrations_lib/storage/setup.py +29 -0
- bb_integrations_lib/util/__init__.py +0 -0
- bb_integrations_lib/util/cache/__init__.py +0 -0
- bb_integrations_lib/util/cache/custom_ttl_cache.py +75 -0
- bb_integrations_lib/util/cache/protocol.py +9 -0
- bb_integrations_lib/util/config/__init__.py +0 -0
- bb_integrations_lib/util/config/manager.py +391 -0
- bb_integrations_lib/util/config/model.py +41 -0
- bb_integrations_lib/util/exception_logger/__init__.py +0 -0
- bb_integrations_lib/util/exception_logger/exception_logger.py +146 -0
- bb_integrations_lib/util/exception_logger/test.py +114 -0
- bb_integrations_lib/util/utils.py +364 -0
- bb_integrations_lib/workers/__init__.py +0 -0
- bb_integrations_lib/workers/groups.py +13 -0
- bb_integrations_lib/workers/rpc_worker.py +50 -0
- bb_integrations_lib/workers/topics.py +20 -0
- bb_integrations_library-3.0.11.dist-info/METADATA +59 -0
- bb_integrations_library-3.0.11.dist-info/RECORD +217 -0
- bb_integrations_library-3.0.11.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2987 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Auto-generated validation tests for Pydantic models.
|
|
3
|
+
Generated on: 2025-07-08 20:08:26
|
|
4
|
+
"""
|
|
5
|
+
import pytest
|
|
6
|
+
from typing import Dict, Any
|
|
7
|
+
from pydantic import BaseModel, ValidationError
|
|
8
|
+
from bb_integrations_lib.gravitate.testing.TTE.sd.models import AllocatedBolResponse, BillableDateType, BillableVolumeType, BlendView, BolAndDropResponse, BolImageResponse, BolImagesRequest, BolImagesResponse, BolsAndDropsRequest, Card, ContractVolumeRequest, Coordinate, Counterparty, CounterpartyView, CreateGroupRequest, DateWindow, DaysOfWeek, DeliveryRequestStatus, DeliveryTicketById, DeliveryTicketByNumber, DeliveryWindow, DeliveryWindowDefault, DriverCredentialUpsertRequest, DriverCredentialView, DriverTerminalCardView, DriverView, DropCreateRequest, DropWorkflow, Dwell, EBolDetailRequest, EBolRequest, ExternalBOLDetailRequest, ExternalBOLRequest, ForecastApiCreateRequest, FormFieldResponse, FormResponseRow, FreightCost, FreightIntegrationReq, FreightItem, FreightTransactionDetailOutput, FreightTransactionOutput, FreightTransactionRowOutput, GetOrderRequestResponse, GetOrderResponse, GetOrdersRequest, HTTPValidationError, ImportRequest, InCabSupplyOptionMode, InCabTripMode, InNetworkSupplyZone, InNetworkTerminal, IntegrationFormResponseOverviewReq, InvoiceAllReq, InvoiceDynamicStatus, InvoiceRow, InvoiceStaticStatus, InvoiceType, Key, LocationResponse, LocationView, MarketSchemaSectorView, MarketView, MonitoringStrategy, NOSupplyOptionResponse, OptimalSupplyReportRequest, OptimalSupplyReportRow, OrderCreateRequest, OrderCreateResponse, OrderCreateStatus, OrderDriver, OrderFreightResp, OrderFreightRespV2, OrderReqNotificationStates, OrderResponse, OrderSchemaBolResponse, OrderSchemaDropResponse, OrderState, OrderStatusUpdateRequest, OrderType, PayrollExportDetailModel, PayrollExportDetailResponse, PriceAllRequest, PriceResponse, PriceType, ProductGroups, ProductIDName, ProductView, PydanticObjectId, RateBookType, RootModel, RouteUpsertReq, SalesAdjustedDeliveryUpsertReq, SaveDropDetail, SaveDropMode, SaveDropReq, Shift, SourceMap, SourcingStrategy, StatusUpdate, StoreStatus, StoreTank, StoreV2, SupplyPriceUpdateManyRequest, SupplyPriceUpdateResponse, SurchargeAllReq, SurchargeAllResp, SurchargeCreateReq, SurchargeType, SurchargeUpdateReq, TankLidEnum, TerminalType, TimezoneEnum, TractorView, TrailerConfigMatrixView, TrailerView, UnavailableHours, UnavailableHoursRequest, UpdateResponse, UploadIMSRequest, UpsertLocationRequest, UpsertManyCounterpartyRequest, UpsertManyDriverRequest, UpsertManyStoreRequest, UpsertProductRequest, UpsertTankRequest, UpsertTractorReq, UpsertTractorResp, UpsertTrailerReq, UpsertTrailerResp, ValidationError, VolumeDistributionRequest, WaterReadingRequirement
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def generic_model_validation_test(model_to_test: BaseModel, example_input: Dict[str, Any]) -> None:
|
|
12
|
+
"""
|
|
13
|
+
Generic test function that validates a model with example input.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
model_to_test: The Pydantic model class to test
|
|
17
|
+
example_input: Dictionary with example input data
|
|
18
|
+
"""
|
|
19
|
+
try:
|
|
20
|
+
validated_model = model_to_test.model_validate(example_input)
|
|
21
|
+
assert validated_model is not None
|
|
22
|
+
model_dict = validated_model.model_dump()
|
|
23
|
+
assert isinstance(model_dict, dict)
|
|
24
|
+
except ValidationError as e:
|
|
25
|
+
pytest.fail(f"Validation failed for {model_to_test.__name__}: {e}")
|
|
26
|
+
except Exception as e:
|
|
27
|
+
pytest.fail(f"Unexpected error for {model_to_test.__name__}: {e}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Individual test functions for each model
|
|
31
|
+
|
|
32
|
+
def test_allocatedbolresponse_validation():
|
|
33
|
+
"""Test validation for AllocatedBolResponse model."""
|
|
34
|
+
example_input = {
|
|
35
|
+
"root": "example_root"
|
|
36
|
+
}
|
|
37
|
+
generic_model_validation_test(AllocatedBolResponse, example_input)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_allocatedbolresponse_validation_with_invalid_data():
|
|
41
|
+
"""Test validation failure for AllocatedBolResponse model with invalid data."""
|
|
42
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
43
|
+
|
|
44
|
+
with pytest.raises(ValidationError):
|
|
45
|
+
AllocatedBolResponse.model_validate(invalid_input)
|
|
46
|
+
|
|
47
|
+
def test_billabledatetype_validation():
|
|
48
|
+
"""Test validation for BillableDateType model."""
|
|
49
|
+
example_input = {
|
|
50
|
+
"root": "example_root"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
generic_model_validation_test(BillableDateType, example_input)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_billabledatetype_validation_with_invalid_data():
|
|
57
|
+
"""Test validation failure for BillableDateType model with invalid data."""
|
|
58
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
59
|
+
|
|
60
|
+
with pytest.raises(ValidationError):
|
|
61
|
+
BillableDateType.model_validate(invalid_input)
|
|
62
|
+
|
|
63
|
+
def test_billablevolumetype_validation():
|
|
64
|
+
"""Test validation for BillableVolumeType model."""
|
|
65
|
+
example_input = {
|
|
66
|
+
"root": "example_root"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
generic_model_validation_test(BillableVolumeType, example_input)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def test_billablevolumetype_validation_with_invalid_data():
|
|
73
|
+
"""Test validation failure for BillableVolumeType model with invalid data."""
|
|
74
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
75
|
+
|
|
76
|
+
with pytest.raises(ValidationError):
|
|
77
|
+
BillableVolumeType.model_validate(invalid_input)
|
|
78
|
+
|
|
79
|
+
def test_blendview_validation():
|
|
80
|
+
"""Test validation for BlendView model."""
|
|
81
|
+
example_input = {
|
|
82
|
+
"root": "example_root"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
generic_model_validation_test(BlendView, example_input)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_blendview_validation_with_invalid_data():
|
|
89
|
+
"""Test validation failure for BlendView model with invalid data."""
|
|
90
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
91
|
+
|
|
92
|
+
with pytest.raises(ValidationError):
|
|
93
|
+
BlendView.model_validate(invalid_input)
|
|
94
|
+
|
|
95
|
+
def test_bolanddropresponse_validation():
|
|
96
|
+
"""Test validation for BolAndDropResponse model."""
|
|
97
|
+
example_input = {
|
|
98
|
+
"order_number": "example_order_number",
|
|
99
|
+
"order_id": "example_order_id",
|
|
100
|
+
"po": "example_po",
|
|
101
|
+
"carrier_id": "example_carrier_id",
|
|
102
|
+
"last_movement_update": "example_last_movement_update",
|
|
103
|
+
"order_date": "example_order_date",
|
|
104
|
+
"status": "example_status",
|
|
105
|
+
"type": "example_type",
|
|
106
|
+
"drops": "example_drops",
|
|
107
|
+
"bols": "example_bols",
|
|
108
|
+
"costs": "example_costs",
|
|
109
|
+
"validation_bypass_on": "example_validation_bypass_on",
|
|
110
|
+
"has_additives": "example_has_additives",
|
|
111
|
+
"estimated_freight": "example_estimated_freight",
|
|
112
|
+
"actual_freight": "example_actual_freight",
|
|
113
|
+
"allocated_bol_error": "example_allocated_bol_error",
|
|
114
|
+
"allocated_bol_issue": "example_allocated_bol_issue",
|
|
115
|
+
"allocated_bols": "example_allocated_bols",
|
|
116
|
+
"last_change_date": "example_last_change_date",
|
|
117
|
+
"reference_order_number": "example_reference_order_number"
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
generic_model_validation_test(BolAndDropResponse, example_input)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def test_bolanddropresponse_validation_with_invalid_data():
|
|
124
|
+
"""Test validation failure for BolAndDropResponse model with invalid data."""
|
|
125
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
126
|
+
|
|
127
|
+
with pytest.raises(ValidationError):
|
|
128
|
+
BolAndDropResponse.model_validate(invalid_input)
|
|
129
|
+
|
|
130
|
+
def test_bolimageresponse_validation():
|
|
131
|
+
"""Test validation for BolImageResponse model."""
|
|
132
|
+
example_input = {
|
|
133
|
+
"root": "example_root"
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
generic_model_validation_test(BolImageResponse, example_input)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_bolimageresponse_validation_with_invalid_data():
|
|
140
|
+
"""Test validation failure for BolImageResponse model with invalid data."""
|
|
141
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
142
|
+
|
|
143
|
+
with pytest.raises(ValidationError):
|
|
144
|
+
BolImageResponse.model_validate(invalid_input)
|
|
145
|
+
|
|
146
|
+
def test_bolimagesrequest_validation():
|
|
147
|
+
"""Test validation for BolImagesRequest model."""
|
|
148
|
+
example_input = {
|
|
149
|
+
"order_ids": "example_order_ids",
|
|
150
|
+
"order_numbers": "example_order_numbers"
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
generic_model_validation_test(BolImagesRequest, example_input)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def test_bolimagesrequest_validation_with_invalid_data():
|
|
157
|
+
"""Test validation failure for BolImagesRequest model with invalid data."""
|
|
158
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
159
|
+
|
|
160
|
+
with pytest.raises(ValidationError):
|
|
161
|
+
BolImagesRequest.model_validate(invalid_input)
|
|
162
|
+
|
|
163
|
+
def test_bolimagesresponse_validation():
|
|
164
|
+
"""Test validation for BolImagesResponse model."""
|
|
165
|
+
example_input = {
|
|
166
|
+
"order_id": "example_order_id",
|
|
167
|
+
"bol_id": "example_bol_id",
|
|
168
|
+
"bol_number": "example_bol_number",
|
|
169
|
+
"photos": "example_photos"
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
generic_model_validation_test(BolImagesResponse, example_input)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_bolimagesresponse_validation_with_invalid_data():
|
|
176
|
+
"""Test validation failure for BolImagesResponse model with invalid data."""
|
|
177
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
178
|
+
|
|
179
|
+
with pytest.raises(ValidationError):
|
|
180
|
+
BolImagesResponse.model_validate(invalid_input)
|
|
181
|
+
|
|
182
|
+
def test_bolsanddropsrequest_validation():
|
|
183
|
+
"""Test validation for BolsAndDropsRequest model."""
|
|
184
|
+
example_input = {
|
|
185
|
+
"order_date_start": "example_order_date_start",
|
|
186
|
+
"order_date_end": "example_order_date_end",
|
|
187
|
+
"movement_updated_start": "example_movement_updated_start",
|
|
188
|
+
"movement_updated_end": "example_movement_updated_end",
|
|
189
|
+
"order_ids": "example_order_ids",
|
|
190
|
+
"order_numbers": "example_order_numbers",
|
|
191
|
+
"order_states": "example_order_states",
|
|
192
|
+
"order_types": "example_order_types",
|
|
193
|
+
"include_invalid": "example_include_invalid",
|
|
194
|
+
"include_bol_allocation": "example_include_bol_allocation",
|
|
195
|
+
"last_change_date": "example_last_change_date",
|
|
196
|
+
"reference_order_numbers": "example_reference_order_numbers"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
generic_model_validation_test(BolsAndDropsRequest, example_input)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def test_bolsanddropsrequest_validation_with_invalid_data():
|
|
203
|
+
"""Test validation failure for BolsAndDropsRequest model with invalid data."""
|
|
204
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
205
|
+
|
|
206
|
+
with pytest.raises(ValidationError):
|
|
207
|
+
BolsAndDropsRequest.model_validate(invalid_input)
|
|
208
|
+
|
|
209
|
+
def test_card_validation():
|
|
210
|
+
"""Test validation for Card model."""
|
|
211
|
+
example_input = {
|
|
212
|
+
"root": "example_root"
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
generic_model_validation_test(Card, example_input)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def test_card_validation_with_invalid_data():
|
|
219
|
+
"""Test validation failure for Card model with invalid data."""
|
|
220
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
221
|
+
|
|
222
|
+
with pytest.raises(ValidationError):
|
|
223
|
+
Card.model_validate(invalid_input)
|
|
224
|
+
|
|
225
|
+
def test_contractvolumerequest_validation():
|
|
226
|
+
"""Test validation for ContractVolumeRequest model."""
|
|
227
|
+
example_input = {
|
|
228
|
+
"root": "example_root"
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
generic_model_validation_test(ContractVolumeRequest, example_input)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def test_contractvolumerequest_validation_with_invalid_data():
|
|
235
|
+
"""Test validation failure for ContractVolumeRequest model with invalid data."""
|
|
236
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
237
|
+
|
|
238
|
+
with pytest.raises(ValidationError):
|
|
239
|
+
ContractVolumeRequest.model_validate(invalid_input)
|
|
240
|
+
|
|
241
|
+
def test_coordinate_validation():
|
|
242
|
+
"""Test validation for Coordinate model."""
|
|
243
|
+
example_input = {
|
|
244
|
+
"root": "example_root"
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
generic_model_validation_test(Coordinate, example_input)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def test_coordinate_validation_with_invalid_data():
|
|
251
|
+
"""Test validation failure for Coordinate model with invalid data."""
|
|
252
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
253
|
+
|
|
254
|
+
with pytest.raises(ValidationError):
|
|
255
|
+
Coordinate.model_validate(invalid_input)
|
|
256
|
+
|
|
257
|
+
def test_counterparty_validation():
|
|
258
|
+
"""Test validation for Counterparty model."""
|
|
259
|
+
example_input = {
|
|
260
|
+
"root": "example_root"
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
generic_model_validation_test(Counterparty, example_input)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def test_counterparty_validation_with_invalid_data():
|
|
267
|
+
"""Test validation failure for Counterparty model with invalid data."""
|
|
268
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
269
|
+
|
|
270
|
+
with pytest.raises(ValidationError):
|
|
271
|
+
Counterparty.model_validate(invalid_input)
|
|
272
|
+
|
|
273
|
+
def test_counterpartyview_validation():
|
|
274
|
+
"""Test validation for CounterpartyView model."""
|
|
275
|
+
example_input = {
|
|
276
|
+
"id": "example_id",
|
|
277
|
+
"name": "example_name",
|
|
278
|
+
"goid": "example_goid",
|
|
279
|
+
"scac": "example_scac",
|
|
280
|
+
"types": "example_types",
|
|
281
|
+
"carrier_type": "example_carrier_type",
|
|
282
|
+
"trailer_config": "example_trailer_config",
|
|
283
|
+
"source_id": "example_source_id",
|
|
284
|
+
"source_system": "example_source_system",
|
|
285
|
+
"source_system_id": "example_source_system_id",
|
|
286
|
+
"emails": "example_emails",
|
|
287
|
+
"sourcing_strategy": "example_sourcing_strategy",
|
|
288
|
+
"extra_data": "example_extra_data",
|
|
289
|
+
"updated_on": "example_updated_on",
|
|
290
|
+
"allow_short_loads": "example_allow_short_loads",
|
|
291
|
+
"order_notification_preferences": "example_order_notification_preferences",
|
|
292
|
+
"supply_map": "example_supply_map"
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
generic_model_validation_test(CounterpartyView, example_input)
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def test_counterpartyview_validation_with_invalid_data():
|
|
299
|
+
"""Test validation failure for CounterpartyView model with invalid data."""
|
|
300
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
301
|
+
|
|
302
|
+
with pytest.raises(ValidationError):
|
|
303
|
+
CounterpartyView.model_validate(invalid_input)
|
|
304
|
+
|
|
305
|
+
def test_creategrouprequest_validation():
|
|
306
|
+
"""Test validation for CreateGroupRequest model."""
|
|
307
|
+
example_input = {
|
|
308
|
+
"source_id": "example_source_id",
|
|
309
|
+
"name": "example_name",
|
|
310
|
+
"keys": "example_keys",
|
|
311
|
+
"as_of": "example_as_of",
|
|
312
|
+
"min": "example_min",
|
|
313
|
+
"max": "example_max",
|
|
314
|
+
"start_hour": "example_start_hour",
|
|
315
|
+
"volume_distributions": "example_volume_distributions",
|
|
316
|
+
"contract_volumes": "example_contract_volumes",
|
|
317
|
+
"daily_percent": "example_daily_percent",
|
|
318
|
+
"weekly_percent": "example_weekly_percent",
|
|
319
|
+
"monthly_percent": "example_monthly_percent",
|
|
320
|
+
"contract_start": "example_contract_start",
|
|
321
|
+
"contract_end": "example_contract_end",
|
|
322
|
+
"week_start_day": "example_week_start_day"
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
generic_model_validation_test(CreateGroupRequest, example_input)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def test_creategrouprequest_validation_with_invalid_data():
|
|
329
|
+
"""Test validation failure for CreateGroupRequest model with invalid data."""
|
|
330
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
331
|
+
|
|
332
|
+
with pytest.raises(ValidationError):
|
|
333
|
+
CreateGroupRequest.model_validate(invalid_input)
|
|
334
|
+
|
|
335
|
+
def test_datewindow_validation():
|
|
336
|
+
"""Test validation for DateWindow model."""
|
|
337
|
+
example_input = {
|
|
338
|
+
"root": "example_root"
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
generic_model_validation_test(DateWindow, example_input)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def test_datewindow_validation_with_invalid_data():
|
|
345
|
+
"""Test validation failure for DateWindow model with invalid data."""
|
|
346
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
347
|
+
|
|
348
|
+
with pytest.raises(ValidationError):
|
|
349
|
+
DateWindow.model_validate(invalid_input)
|
|
350
|
+
|
|
351
|
+
def test_daysofweek_validation():
|
|
352
|
+
"""Test validation for DaysOfWeek model."""
|
|
353
|
+
example_input = {
|
|
354
|
+
"root": "example_root"
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
generic_model_validation_test(DaysOfWeek, example_input)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
def test_daysofweek_validation_with_invalid_data():
|
|
361
|
+
"""Test validation failure for DaysOfWeek model with invalid data."""
|
|
362
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
363
|
+
|
|
364
|
+
with pytest.raises(ValidationError):
|
|
365
|
+
DaysOfWeek.model_validate(invalid_input)
|
|
366
|
+
|
|
367
|
+
def test_deliveryrequeststatus_validation():
|
|
368
|
+
"""Test validation for DeliveryRequestStatus model."""
|
|
369
|
+
example_input = {
|
|
370
|
+
"root": "example_root"
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
generic_model_validation_test(DeliveryRequestStatus, example_input)
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
def test_deliveryrequeststatus_validation_with_invalid_data():
|
|
377
|
+
"""Test validation failure for DeliveryRequestStatus model with invalid data."""
|
|
378
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
379
|
+
|
|
380
|
+
with pytest.raises(ValidationError):
|
|
381
|
+
DeliveryRequestStatus.model_validate(invalid_input)
|
|
382
|
+
|
|
383
|
+
def test_deliveryticketbyid_validation():
|
|
384
|
+
"""Test validation for DeliveryTicketById model."""
|
|
385
|
+
example_input = {
|
|
386
|
+
"order_id": "example_order_id",
|
|
387
|
+
"store_id": "example_store_id"
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
generic_model_validation_test(DeliveryTicketById, example_input)
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def test_deliveryticketbyid_validation_with_invalid_data():
|
|
394
|
+
"""Test validation failure for DeliveryTicketById model with invalid data."""
|
|
395
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
396
|
+
|
|
397
|
+
with pytest.raises(ValidationError):
|
|
398
|
+
DeliveryTicketById.model_validate(invalid_input)
|
|
399
|
+
|
|
400
|
+
def test_deliveryticketbynumber_validation():
|
|
401
|
+
"""Test validation for DeliveryTicketByNumber model."""
|
|
402
|
+
example_input = {
|
|
403
|
+
"order_number": 42,
|
|
404
|
+
"store_number": "example_store_number"
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
generic_model_validation_test(DeliveryTicketByNumber, example_input)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def test_deliveryticketbynumber_validation_with_invalid_data():
|
|
411
|
+
"""Test validation failure for DeliveryTicketByNumber model with invalid data."""
|
|
412
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
413
|
+
|
|
414
|
+
with pytest.raises(ValidationError):
|
|
415
|
+
DeliveryTicketByNumber.model_validate(invalid_input)
|
|
416
|
+
|
|
417
|
+
def test_deliverywindow_validation():
|
|
418
|
+
"""Test validation for DeliveryWindow model."""
|
|
419
|
+
example_input = {
|
|
420
|
+
"root": "example_root"
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
generic_model_validation_test(DeliveryWindow, example_input)
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
def test_deliverywindow_validation_with_invalid_data():
|
|
427
|
+
"""Test validation failure for DeliveryWindow model with invalid data."""
|
|
428
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
429
|
+
|
|
430
|
+
with pytest.raises(ValidationError):
|
|
431
|
+
DeliveryWindow.model_validate(invalid_input)
|
|
432
|
+
|
|
433
|
+
def test_deliverywindowdefault_validation():
|
|
434
|
+
"""Test validation for DeliveryWindowDefault model."""
|
|
435
|
+
example_input = {
|
|
436
|
+
"root": "example_root"
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
generic_model_validation_test(DeliveryWindowDefault, example_input)
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
def test_deliverywindowdefault_validation_with_invalid_data():
|
|
443
|
+
"""Test validation failure for DeliveryWindowDefault model with invalid data."""
|
|
444
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
445
|
+
|
|
446
|
+
with pytest.raises(ValidationError):
|
|
447
|
+
DeliveryWindowDefault.model_validate(invalid_input)
|
|
448
|
+
|
|
449
|
+
def test_drivercredentialupsertrequest_validation():
|
|
450
|
+
"""Test validation for DriverCredentialUpsertRequest model."""
|
|
451
|
+
example_input = {
|
|
452
|
+
"driver_id": "example_driver_id",
|
|
453
|
+
"credential_id": "example_credential_id",
|
|
454
|
+
"certification_date": "example_certification_date",
|
|
455
|
+
"expiration_date": "example_expiration_date"
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
generic_model_validation_test(DriverCredentialUpsertRequest, example_input)
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
def test_drivercredentialupsertrequest_validation_with_invalid_data():
|
|
462
|
+
"""Test validation failure for DriverCredentialUpsertRequest model with invalid data."""
|
|
463
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
464
|
+
|
|
465
|
+
with pytest.raises(ValidationError):
|
|
466
|
+
DriverCredentialUpsertRequest.model_validate(invalid_input)
|
|
467
|
+
|
|
468
|
+
def test_drivercredentialview_validation():
|
|
469
|
+
"""Test validation for DriverCredentialView model."""
|
|
470
|
+
example_input = {
|
|
471
|
+
"root": "example_root"
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
generic_model_validation_test(DriverCredentialView, example_input)
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
def test_drivercredentialview_validation_with_invalid_data():
|
|
478
|
+
"""Test validation failure for DriverCredentialView model with invalid data."""
|
|
479
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
480
|
+
|
|
481
|
+
with pytest.raises(ValidationError):
|
|
482
|
+
DriverCredentialView.model_validate(invalid_input)
|
|
483
|
+
|
|
484
|
+
def test_driverterminalcardview_validation():
|
|
485
|
+
"""Test validation for DriverTerminalCardView model."""
|
|
486
|
+
example_input = {
|
|
487
|
+
"root": "example_root"
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
generic_model_validation_test(DriverTerminalCardView, example_input)
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
def test_driverterminalcardview_validation_with_invalid_data():
|
|
494
|
+
"""Test validation failure for DriverTerminalCardView model with invalid data."""
|
|
495
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
496
|
+
|
|
497
|
+
with pytest.raises(ValidationError):
|
|
498
|
+
DriverTerminalCardView.model_validate(invalid_input)
|
|
499
|
+
|
|
500
|
+
def test_driverview_validation():
|
|
501
|
+
"""Test validation for DriverView model."""
|
|
502
|
+
example_input = {
|
|
503
|
+
"id": "example_id",
|
|
504
|
+
"name": "example_name",
|
|
505
|
+
"username": "example_username",
|
|
506
|
+
"depot_id": "example_depot_id",
|
|
507
|
+
"depot_name": "example_depot_name",
|
|
508
|
+
"in_cab_trip_mode": "example_in_cab_trip_mode",
|
|
509
|
+
"in_cab_supply_option_mode": "example_in_cab_supply_option_mode",
|
|
510
|
+
"trailer_number": "example_trailer_number",
|
|
511
|
+
"tractor_number": "example_tractor_number",
|
|
512
|
+
"updated_on": "example_updated_on",
|
|
513
|
+
"extra_data": "example_extra_data",
|
|
514
|
+
"cards": "example_cards",
|
|
515
|
+
"credentials": "example_credentials"
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
generic_model_validation_test(DriverView, example_input)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
def test_driverview_validation_with_invalid_data():
|
|
522
|
+
"""Test validation failure for DriverView model with invalid data."""
|
|
523
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
524
|
+
|
|
525
|
+
with pytest.raises(ValidationError):
|
|
526
|
+
DriverView.model_validate(invalid_input)
|
|
527
|
+
|
|
528
|
+
def test_dropcreaterequest_validation():
|
|
529
|
+
"""Test validation for DropCreateRequest model."""
|
|
530
|
+
example_input = {
|
|
531
|
+
"root": "example_root"
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
generic_model_validation_test(DropCreateRequest, example_input)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
def test_dropcreaterequest_validation_with_invalid_data():
|
|
538
|
+
"""Test validation failure for DropCreateRequest model with invalid data."""
|
|
539
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
540
|
+
|
|
541
|
+
with pytest.raises(ValidationError):
|
|
542
|
+
DropCreateRequest.model_validate(invalid_input)
|
|
543
|
+
|
|
544
|
+
def test_dropworkflow_validation():
|
|
545
|
+
"""Test validation for DropWorkflow model."""
|
|
546
|
+
example_input = {
|
|
547
|
+
"root": "example_root"
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
generic_model_validation_test(DropWorkflow, example_input)
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
def test_dropworkflow_validation_with_invalid_data():
|
|
554
|
+
"""Test validation failure for DropWorkflow model with invalid data."""
|
|
555
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
556
|
+
|
|
557
|
+
with pytest.raises(ValidationError):
|
|
558
|
+
DropWorkflow.model_validate(invalid_input)
|
|
559
|
+
|
|
560
|
+
def test_dwell_validation():
|
|
561
|
+
"""Test validation for Dwell model."""
|
|
562
|
+
example_input = {
|
|
563
|
+
"root": "example_root"
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
generic_model_validation_test(Dwell, example_input)
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
def test_dwell_validation_with_invalid_data():
|
|
570
|
+
"""Test validation failure for Dwell model with invalid data."""
|
|
571
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
572
|
+
|
|
573
|
+
with pytest.raises(ValidationError):
|
|
574
|
+
Dwell.model_validate(invalid_input)
|
|
575
|
+
|
|
576
|
+
def test_eboldetailrequest_validation():
|
|
577
|
+
"""Test validation for EBolDetailRequest model."""
|
|
578
|
+
example_input = {
|
|
579
|
+
"root": "example_root"
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
generic_model_validation_test(EBolDetailRequest, example_input)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def test_eboldetailrequest_validation_with_invalid_data():
|
|
586
|
+
"""Test validation failure for EBolDetailRequest model with invalid data."""
|
|
587
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
588
|
+
|
|
589
|
+
with pytest.raises(ValidationError):
|
|
590
|
+
EBolDetailRequest.model_validate(invalid_input)
|
|
591
|
+
|
|
592
|
+
def test_ebolrequest_validation():
|
|
593
|
+
"""Test validation for EBolRequest model."""
|
|
594
|
+
example_input = {
|
|
595
|
+
"source_system": "example_source_system",
|
|
596
|
+
"bol_number": "example_bol_number",
|
|
597
|
+
"date": "example_date",
|
|
598
|
+
"terminal_id": "example_terminal_id",
|
|
599
|
+
"supplier_id": "example_supplier_id",
|
|
600
|
+
"details": "example_details"
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
generic_model_validation_test(EBolRequest, example_input)
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
def test_ebolrequest_validation_with_invalid_data():
|
|
607
|
+
"""Test validation failure for EBolRequest model with invalid data."""
|
|
608
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
609
|
+
|
|
610
|
+
with pytest.raises(ValidationError):
|
|
611
|
+
EBolRequest.model_validate(invalid_input)
|
|
612
|
+
|
|
613
|
+
def test_externalboldetailrequest_validation():
|
|
614
|
+
"""Test validation for ExternalBOLDetailRequest model."""
|
|
615
|
+
example_input = {
|
|
616
|
+
"root": "example_root"
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
generic_model_validation_test(ExternalBOLDetailRequest, example_input)
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
def test_externalboldetailrequest_validation_with_invalid_data():
|
|
623
|
+
"""Test validation failure for ExternalBOLDetailRequest model with invalid data."""
|
|
624
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
625
|
+
|
|
626
|
+
with pytest.raises(ValidationError):
|
|
627
|
+
ExternalBOLDetailRequest.model_validate(invalid_input)
|
|
628
|
+
|
|
629
|
+
def test_externalbolrequest_validation():
|
|
630
|
+
"""Test validation for ExternalBOLRequest model."""
|
|
631
|
+
example_input = {
|
|
632
|
+
"order_id": "example_order_id",
|
|
633
|
+
"bol_number": "example_bol_number",
|
|
634
|
+
"terminal_id": "example_terminal_id",
|
|
635
|
+
"bol_date": "example_bol_date",
|
|
636
|
+
"details": "example_details"
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
generic_model_validation_test(ExternalBOLRequest, example_input)
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
def test_externalbolrequest_validation_with_invalid_data():
|
|
643
|
+
"""Test validation failure for ExternalBOLRequest model with invalid data."""
|
|
644
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
645
|
+
|
|
646
|
+
with pytest.raises(ValidationError):
|
|
647
|
+
ExternalBOLRequest.model_validate(invalid_input)
|
|
648
|
+
|
|
649
|
+
def test_forecastapicreaterequest_validation():
|
|
650
|
+
"""Test validation for ForecastApiCreateRequest model."""
|
|
651
|
+
example_input = {
|
|
652
|
+
"root": "example_root"
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
generic_model_validation_test(ForecastApiCreateRequest, example_input)
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
def test_forecastapicreaterequest_validation_with_invalid_data():
|
|
659
|
+
"""Test validation failure for ForecastApiCreateRequest model with invalid data."""
|
|
660
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
661
|
+
|
|
662
|
+
with pytest.raises(ValidationError):
|
|
663
|
+
ForecastApiCreateRequest.model_validate(invalid_input)
|
|
664
|
+
|
|
665
|
+
def test_formfieldresponse_validation():
|
|
666
|
+
"""Test validation for FormFieldResponse model."""
|
|
667
|
+
example_input = {
|
|
668
|
+
"root": "example_root"
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
generic_model_validation_test(FormFieldResponse, example_input)
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
def test_formfieldresponse_validation_with_invalid_data():
|
|
675
|
+
"""Test validation failure for FormFieldResponse model with invalid data."""
|
|
676
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
677
|
+
|
|
678
|
+
with pytest.raises(ValidationError):
|
|
679
|
+
FormFieldResponse.model_validate(invalid_input)
|
|
680
|
+
|
|
681
|
+
def test_formresponserow_validation():
|
|
682
|
+
"""Test validation for FormResponseRow model."""
|
|
683
|
+
example_input = {
|
|
684
|
+
"id": "example_id",
|
|
685
|
+
"name": "example_name",
|
|
686
|
+
"description": "example_description",
|
|
687
|
+
"order_number": 42,
|
|
688
|
+
"driver_name": "example_driver_name",
|
|
689
|
+
"date": "example_date",
|
|
690
|
+
"shift": "example_shift",
|
|
691
|
+
"location_name": "example_location_name",
|
|
692
|
+
"address": "example_address",
|
|
693
|
+
"latitude": "example_latitude",
|
|
694
|
+
"longitude": "example_longitude",
|
|
695
|
+
"market": "example_market",
|
|
696
|
+
"sector": "example_sector",
|
|
697
|
+
"supply_zones": "example_supply_zones",
|
|
698
|
+
"tractor": "example_tractor",
|
|
699
|
+
"trailer_number": "example_trailer_number",
|
|
700
|
+
"required": "example_required",
|
|
701
|
+
"response": "example_response"
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
generic_model_validation_test(FormResponseRow, example_input)
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
def test_formresponserow_validation_with_invalid_data():
|
|
708
|
+
"""Test validation failure for FormResponseRow model with invalid data."""
|
|
709
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
710
|
+
|
|
711
|
+
with pytest.raises(ValidationError):
|
|
712
|
+
FormResponseRow.model_validate(invalid_input)
|
|
713
|
+
|
|
714
|
+
def test_freightcost_validation():
|
|
715
|
+
"""Test validation for FreightCost model."""
|
|
716
|
+
example_input = {
|
|
717
|
+
"root": "example_root"
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
generic_model_validation_test(FreightCost, example_input)
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
def test_freightcost_validation_with_invalid_data():
|
|
724
|
+
"""Test validation failure for FreightCost model with invalid data."""
|
|
725
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
726
|
+
|
|
727
|
+
with pytest.raises(ValidationError):
|
|
728
|
+
FreightCost.model_validate(invalid_input)
|
|
729
|
+
|
|
730
|
+
def test_freightintegrationreq_validation():
|
|
731
|
+
"""Test validation for FreightIntegrationReq model."""
|
|
732
|
+
example_input = {
|
|
733
|
+
"order_numbers": "example_order_numbers",
|
|
734
|
+
"order_ids": "example_order_ids",
|
|
735
|
+
"last_change_date": "example_last_change_date"
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
generic_model_validation_test(FreightIntegrationReq, example_input)
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
def test_freightintegrationreq_validation_with_invalid_data():
|
|
742
|
+
"""Test validation failure for FreightIntegrationReq model with invalid data."""
|
|
743
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
744
|
+
|
|
745
|
+
with pytest.raises(ValidationError):
|
|
746
|
+
FreightIntegrationReq.model_validate(invalid_input)
|
|
747
|
+
|
|
748
|
+
def test_freightitem_validation():
|
|
749
|
+
"""Test validation for FreightItem model."""
|
|
750
|
+
example_input = {
|
|
751
|
+
"root": "example_root"
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
generic_model_validation_test(FreightItem, example_input)
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
def test_freightitem_validation_with_invalid_data():
|
|
758
|
+
"""Test validation failure for FreightItem model with invalid data."""
|
|
759
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
760
|
+
|
|
761
|
+
with pytest.raises(ValidationError):
|
|
762
|
+
FreightItem.model_validate(invalid_input)
|
|
763
|
+
|
|
764
|
+
def test_freighttransactiondetailoutput_validation():
|
|
765
|
+
"""Test validation for FreightTransactionDetailOutput model."""
|
|
766
|
+
example_input = {
|
|
767
|
+
"root": "example_root"
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
generic_model_validation_test(FreightTransactionDetailOutput, example_input)
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
def test_freighttransactiondetailoutput_validation_with_invalid_data():
|
|
774
|
+
"""Test validation failure for FreightTransactionDetailOutput model with invalid data."""
|
|
775
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
776
|
+
|
|
777
|
+
with pytest.raises(ValidationError):
|
|
778
|
+
FreightTransactionDetailOutput.model_validate(invalid_input)
|
|
779
|
+
|
|
780
|
+
def test_freighttransactionoutput_validation():
|
|
781
|
+
"""Test validation for FreightTransactionOutput model."""
|
|
782
|
+
example_input = {
|
|
783
|
+
"root": "example_root"
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
generic_model_validation_test(FreightTransactionOutput, example_input)
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
def test_freighttransactionoutput_validation_with_invalid_data():
|
|
790
|
+
"""Test validation failure for FreightTransactionOutput model with invalid data."""
|
|
791
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
792
|
+
|
|
793
|
+
with pytest.raises(ValidationError):
|
|
794
|
+
FreightTransactionOutput.model_validate(invalid_input)
|
|
795
|
+
|
|
796
|
+
def test_freighttransactionrowoutput_validation():
|
|
797
|
+
"""Test validation for FreightTransactionRowOutput model."""
|
|
798
|
+
example_input = {
|
|
799
|
+
"root": "example_root"
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
generic_model_validation_test(FreightTransactionRowOutput, example_input)
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
def test_freighttransactionrowoutput_validation_with_invalid_data():
|
|
806
|
+
"""Test validation failure for FreightTransactionRowOutput model with invalid data."""
|
|
807
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
808
|
+
|
|
809
|
+
with pytest.raises(ValidationError):
|
|
810
|
+
FreightTransactionRowOutput.model_validate(invalid_input)
|
|
811
|
+
|
|
812
|
+
def test_getorderrequestresponse_validation():
|
|
813
|
+
"""Test validation for GetOrderRequestResponse model."""
|
|
814
|
+
example_input = {
|
|
815
|
+
"type": "example_type",
|
|
816
|
+
"number": 42,
|
|
817
|
+
"order_id": "example_order_id",
|
|
818
|
+
"order_number": "example_order_number",
|
|
819
|
+
"order_date": "example_order_date",
|
|
820
|
+
"order_state": "example_order_state",
|
|
821
|
+
"reference_order_number": "example_reference_order_number",
|
|
822
|
+
"last_change_date": "example_last_change_date",
|
|
823
|
+
"site_name": "example_site_name",
|
|
824
|
+
"site_id": "example_site_id",
|
|
825
|
+
"customer_id": "example_customer_id",
|
|
826
|
+
"customer_name": "example_customer_name",
|
|
827
|
+
"delivery_window_start": "example_delivery_window_start",
|
|
828
|
+
"delivery_window_end": "example_delivery_window_end",
|
|
829
|
+
"products": "example_products",
|
|
830
|
+
"extra_data": "example_extra_data",
|
|
831
|
+
"status": "example_status"
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
generic_model_validation_test(GetOrderRequestResponse, example_input)
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def test_getorderrequestresponse_validation_with_invalid_data():
|
|
838
|
+
"""Test validation failure for GetOrderRequestResponse model with invalid data."""
|
|
839
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
840
|
+
|
|
841
|
+
with pytest.raises(ValidationError):
|
|
842
|
+
GetOrderRequestResponse.model_validate(invalid_input)
|
|
843
|
+
|
|
844
|
+
def test_getorderresponse_validation():
|
|
845
|
+
"""Test validation for GetOrderResponse model."""
|
|
846
|
+
example_input = {
|
|
847
|
+
"type": "example_type",
|
|
848
|
+
"order_id": "example_order_id",
|
|
849
|
+
"drivers": "example_drivers",
|
|
850
|
+
"order_number": "example_order_number",
|
|
851
|
+
"order_date": "example_order_date",
|
|
852
|
+
"order_state": "example_order_state",
|
|
853
|
+
"carrier_window_start": "example_carrier_window_start",
|
|
854
|
+
"carrier_window_end": "example_carrier_window_end",
|
|
855
|
+
"carrier_notify_state": "example_carrier_notify_state",
|
|
856
|
+
"load_window_start": "example_load_window_start",
|
|
857
|
+
"load_window_end": "example_load_window_end",
|
|
858
|
+
"dispatch_window_start": "example_dispatch_window_start",
|
|
859
|
+
"dispatch_window_end": "example_dispatch_window_end",
|
|
860
|
+
"hauler_counterparty_id": "example_hauler_counterparty_id",
|
|
861
|
+
"hauler_counterparty_name": "example_hauler_counterparty_name",
|
|
862
|
+
"hauler_counterparty_source_id": "example_hauler_counterparty_source_id",
|
|
863
|
+
"hauler_counterparty_source_system": "example_hauler_counterparty_source_system",
|
|
864
|
+
"hauled_by_updated_by": "example_hauled_by_updated_by",
|
|
865
|
+
"hauled_by_updated": "example_hauled_by_updated",
|
|
866
|
+
"loads": "example_loads",
|
|
867
|
+
"drops": "example_drops",
|
|
868
|
+
"trip_status": "example_trip_status",
|
|
869
|
+
"last_change_date": "example_last_change_date",
|
|
870
|
+
"market": "example_market",
|
|
871
|
+
"supply_option": "example_supply_option",
|
|
872
|
+
"created_by": "example_created_by",
|
|
873
|
+
"note": "example_note",
|
|
874
|
+
"estimated_load_minutes": "example_estimated_load_minutes",
|
|
875
|
+
"total_miles": "example_total_miles",
|
|
876
|
+
"loaded_miles": "example_loaded_miles",
|
|
877
|
+
"unloaded_miles": "example_unloaded_miles",
|
|
878
|
+
"reference_order_number": "example_reference_order_number",
|
|
879
|
+
"extra_data": "example_extra_data"
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
generic_model_validation_test(GetOrderResponse, example_input)
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
def test_getorderresponse_validation_with_invalid_data():
|
|
886
|
+
"""Test validation failure for GetOrderResponse model with invalid data."""
|
|
887
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
888
|
+
|
|
889
|
+
with pytest.raises(ValidationError):
|
|
890
|
+
GetOrderResponse.model_validate(invalid_input)
|
|
891
|
+
|
|
892
|
+
def test_getordersrequest_validation():
|
|
893
|
+
"""Test validation for GetOrdersRequest model."""
|
|
894
|
+
example_input = {
|
|
895
|
+
"order_id": "example_order_id",
|
|
896
|
+
"order_number": "example_order_number",
|
|
897
|
+
"type": "example_type",
|
|
898
|
+
"state": "example_state",
|
|
899
|
+
"last_change_date": "example_last_change_date",
|
|
900
|
+
"order_date_start": "example_order_date_start",
|
|
901
|
+
"order_date_end": "example_order_date_end",
|
|
902
|
+
"reference_order_number": "example_reference_order_number",
|
|
903
|
+
"order_date": "example_order_date"
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
generic_model_validation_test(GetOrdersRequest, example_input)
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
def test_getordersrequest_validation_with_invalid_data():
|
|
910
|
+
"""Test validation failure for GetOrdersRequest model with invalid data."""
|
|
911
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
912
|
+
|
|
913
|
+
with pytest.raises(ValidationError):
|
|
914
|
+
GetOrdersRequest.model_validate(invalid_input)
|
|
915
|
+
|
|
916
|
+
def test_httpvalidationerror_validation():
|
|
917
|
+
"""Test validation for HTTPValidationError model."""
|
|
918
|
+
example_input = {
|
|
919
|
+
"detail": "example_detail"
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
generic_model_validation_test(HTTPValidationError, example_input)
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
def test_httpvalidationerror_validation_with_invalid_data():
|
|
926
|
+
"""Test validation failure for HTTPValidationError model with invalid data."""
|
|
927
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
928
|
+
|
|
929
|
+
with pytest.raises(ValidationError):
|
|
930
|
+
HTTPValidationError.model_validate(invalid_input)
|
|
931
|
+
|
|
932
|
+
def test_importrequest_validation():
|
|
933
|
+
"""Test validation for ImportRequest model."""
|
|
934
|
+
example_input = {
|
|
935
|
+
"reqs": "example_reqs"
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
generic_model_validation_test(ImportRequest, example_input)
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
def test_importrequest_validation_with_invalid_data():
|
|
942
|
+
"""Test validation failure for ImportRequest model with invalid data."""
|
|
943
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
944
|
+
|
|
945
|
+
with pytest.raises(ValidationError):
|
|
946
|
+
ImportRequest.model_validate(invalid_input)
|
|
947
|
+
|
|
948
|
+
def test_incabsupplyoptionmode_validation():
|
|
949
|
+
"""Test validation for InCabSupplyOptionMode model."""
|
|
950
|
+
example_input = {
|
|
951
|
+
"root": "example_root"
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
generic_model_validation_test(InCabSupplyOptionMode, example_input)
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
def test_incabsupplyoptionmode_validation_with_invalid_data():
|
|
958
|
+
"""Test validation failure for InCabSupplyOptionMode model with invalid data."""
|
|
959
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
960
|
+
|
|
961
|
+
with pytest.raises(ValidationError):
|
|
962
|
+
InCabSupplyOptionMode.model_validate(invalid_input)
|
|
963
|
+
|
|
964
|
+
def test_incabtripmode_validation():
|
|
965
|
+
"""Test validation for InCabTripMode model."""
|
|
966
|
+
example_input = {
|
|
967
|
+
"root": "example_root"
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
generic_model_validation_test(InCabTripMode, example_input)
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
def test_incabtripmode_validation_with_invalid_data():
|
|
974
|
+
"""Test validation failure for InCabTripMode model with invalid data."""
|
|
975
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
976
|
+
|
|
977
|
+
with pytest.raises(ValidationError):
|
|
978
|
+
InCabTripMode.model_validate(invalid_input)
|
|
979
|
+
|
|
980
|
+
def test_innetworksupplyzone_validation():
|
|
981
|
+
"""Test validation for InNetworkSupplyZone model."""
|
|
982
|
+
example_input = {
|
|
983
|
+
"root": "example_root"
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
generic_model_validation_test(InNetworkSupplyZone, example_input)
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
def test_innetworksupplyzone_validation_with_invalid_data():
|
|
990
|
+
"""Test validation failure for InNetworkSupplyZone model with invalid data."""
|
|
991
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
992
|
+
|
|
993
|
+
with pytest.raises(ValidationError):
|
|
994
|
+
InNetworkSupplyZone.model_validate(invalid_input)
|
|
995
|
+
|
|
996
|
+
def test_innetworkterminal_validation():
|
|
997
|
+
"""Test validation for InNetworkTerminal model."""
|
|
998
|
+
example_input = {
|
|
999
|
+
"root": "example_root"
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
generic_model_validation_test(InNetworkTerminal, example_input)
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
def test_innetworkterminal_validation_with_invalid_data():
|
|
1006
|
+
"""Test validation failure for InNetworkTerminal model with invalid data."""
|
|
1007
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1008
|
+
|
|
1009
|
+
with pytest.raises(ValidationError):
|
|
1010
|
+
InNetworkTerminal.model_validate(invalid_input)
|
|
1011
|
+
|
|
1012
|
+
def test_integrationformresponseoverviewreq_validation():
|
|
1013
|
+
"""Test validation for IntegrationFormResponseOverviewReq model."""
|
|
1014
|
+
example_input = {
|
|
1015
|
+
"form_name": "example_form_name",
|
|
1016
|
+
"from_date": "example_from_date",
|
|
1017
|
+
"to_date": "example_to_date",
|
|
1018
|
+
"market": "example_market"
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
generic_model_validation_test(IntegrationFormResponseOverviewReq, example_input)
|
|
1022
|
+
|
|
1023
|
+
|
|
1024
|
+
def test_integrationformresponseoverviewreq_validation_with_invalid_data():
|
|
1025
|
+
"""Test validation failure for IntegrationFormResponseOverviewReq model with invalid data."""
|
|
1026
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1027
|
+
|
|
1028
|
+
with pytest.raises(ValidationError):
|
|
1029
|
+
IntegrationFormResponseOverviewReq.model_validate(invalid_input)
|
|
1030
|
+
|
|
1031
|
+
def test_invoiceallreq_validation():
|
|
1032
|
+
"""Test validation for InvoiceAllReq model."""
|
|
1033
|
+
example_input = {
|
|
1034
|
+
"order_numbers": "example_order_numbers",
|
|
1035
|
+
"order_ids": "example_order_ids",
|
|
1036
|
+
"invoice_numbers": "example_invoice_numbers",
|
|
1037
|
+
"status": "example_status",
|
|
1038
|
+
"counterparty_name": "example_counterparty_name",
|
|
1039
|
+
"counterparty_id": "example_counterparty_id",
|
|
1040
|
+
"book_type": "example_book_type",
|
|
1041
|
+
"as_of": "example_as_of",
|
|
1042
|
+
"between": "example_between"
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
generic_model_validation_test(InvoiceAllReq, example_input)
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
def test_invoiceallreq_validation_with_invalid_data():
|
|
1049
|
+
"""Test validation failure for InvoiceAllReq model with invalid data."""
|
|
1050
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1051
|
+
|
|
1052
|
+
with pytest.raises(ValidationError):
|
|
1053
|
+
InvoiceAllReq.model_validate(invalid_input)
|
|
1054
|
+
|
|
1055
|
+
def test_invoicedynamicstatus_validation():
|
|
1056
|
+
"""Test validation for InvoiceDynamicStatus model."""
|
|
1057
|
+
example_input = {
|
|
1058
|
+
"root": "example_root"
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
generic_model_validation_test(InvoiceDynamicStatus, example_input)
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
def test_invoicedynamicstatus_validation_with_invalid_data():
|
|
1065
|
+
"""Test validation failure for InvoiceDynamicStatus model with invalid data."""
|
|
1066
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1067
|
+
|
|
1068
|
+
with pytest.raises(ValidationError):
|
|
1069
|
+
InvoiceDynamicStatus.model_validate(invalid_input)
|
|
1070
|
+
|
|
1071
|
+
def test_invoicerow_validation():
|
|
1072
|
+
"""Test validation for InvoiceRow model."""
|
|
1073
|
+
example_input = {
|
|
1074
|
+
"invoice_number": "example_invoice_number",
|
|
1075
|
+
"sent_date": "example_sent_date",
|
|
1076
|
+
"when_to_send_date": "example_when_to_send_date",
|
|
1077
|
+
"created_on": "example_created_on",
|
|
1078
|
+
"type": "example_type",
|
|
1079
|
+
"status": "example_status",
|
|
1080
|
+
"transactions": "example_transactions",
|
|
1081
|
+
"note": "example_note",
|
|
1082
|
+
"base_amount": 3.14,
|
|
1083
|
+
"base_distance": 3.14,
|
|
1084
|
+
"distance_uom": "example_distance_uom",
|
|
1085
|
+
"accessorial_amount": 3.14,
|
|
1086
|
+
"surcharge_amount": 3.14,
|
|
1087
|
+
"total_amount": 3.14
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
generic_model_validation_test(InvoiceRow, example_input)
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
def test_invoicerow_validation_with_invalid_data():
|
|
1094
|
+
"""Test validation failure for InvoiceRow model with invalid data."""
|
|
1095
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1096
|
+
|
|
1097
|
+
with pytest.raises(ValidationError):
|
|
1098
|
+
InvoiceRow.model_validate(invalid_input)
|
|
1099
|
+
|
|
1100
|
+
def test_invoicestaticstatus_validation():
|
|
1101
|
+
"""Test validation for InvoiceStaticStatus model."""
|
|
1102
|
+
example_input = {
|
|
1103
|
+
"root": "example_root"
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
generic_model_validation_test(InvoiceStaticStatus, example_input)
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
def test_invoicestaticstatus_validation_with_invalid_data():
|
|
1110
|
+
"""Test validation failure for InvoiceStaticStatus model with invalid data."""
|
|
1111
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1112
|
+
|
|
1113
|
+
with pytest.raises(ValidationError):
|
|
1114
|
+
InvoiceStaticStatus.model_validate(invalid_input)
|
|
1115
|
+
|
|
1116
|
+
def test_invoicetype_validation():
|
|
1117
|
+
"""Test validation for InvoiceType model."""
|
|
1118
|
+
example_input = {
|
|
1119
|
+
"root": "example_root"
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
generic_model_validation_test(InvoiceType, example_input)
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
def test_invoicetype_validation_with_invalid_data():
|
|
1126
|
+
"""Test validation failure for InvoiceType model with invalid data."""
|
|
1127
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1128
|
+
|
|
1129
|
+
with pytest.raises(ValidationError):
|
|
1130
|
+
InvoiceType.model_validate(invalid_input)
|
|
1131
|
+
|
|
1132
|
+
def test_key_validation():
|
|
1133
|
+
"""Test validation for Key model."""
|
|
1134
|
+
example_input = {
|
|
1135
|
+
"root": "example_root"
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
generic_model_validation_test(Key, example_input)
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
def test_key_validation_with_invalid_data():
|
|
1142
|
+
"""Test validation failure for Key model with invalid data."""
|
|
1143
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1144
|
+
|
|
1145
|
+
with pytest.raises(ValidationError):
|
|
1146
|
+
Key.model_validate(invalid_input)
|
|
1147
|
+
|
|
1148
|
+
def test_locationresponse_validation():
|
|
1149
|
+
"""Test validation for LocationResponse model."""
|
|
1150
|
+
example_input = {
|
|
1151
|
+
"root": "example_root"
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
generic_model_validation_test(LocationResponse, example_input)
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
def test_locationresponse_validation_with_invalid_data():
|
|
1158
|
+
"""Test validation failure for LocationResponse model with invalid data."""
|
|
1159
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1160
|
+
|
|
1161
|
+
with pytest.raises(ValidationError):
|
|
1162
|
+
LocationResponse.model_validate(invalid_input)
|
|
1163
|
+
|
|
1164
|
+
def test_locationview_validation():
|
|
1165
|
+
"""Test validation for LocationView model."""
|
|
1166
|
+
example_input = {
|
|
1167
|
+
"id": "example_id",
|
|
1168
|
+
"name": "example_name",
|
|
1169
|
+
"short_name": "example_short_name",
|
|
1170
|
+
"market": "example_market",
|
|
1171
|
+
"market_id": "example_market_id",
|
|
1172
|
+
"freight_region_name": "example_freight_region_name",
|
|
1173
|
+
"freight_region_id": "example_freight_region_id",
|
|
1174
|
+
"type": "example_type",
|
|
1175
|
+
"lat": "example_lat",
|
|
1176
|
+
"lon": "example_lon",
|
|
1177
|
+
"address": "example_address",
|
|
1178
|
+
"phone": "example_phone",
|
|
1179
|
+
"city": "example_city",
|
|
1180
|
+
"state": "example_state",
|
|
1181
|
+
"active": "example_active",
|
|
1182
|
+
"postal_code": "example_postal_code",
|
|
1183
|
+
"source_id": "example_source_id",
|
|
1184
|
+
"source_system": "example_source_system",
|
|
1185
|
+
"source_system_id": "example_source_system_id",
|
|
1186
|
+
"timezone": "example_timezone",
|
|
1187
|
+
"supply_zones": "example_supply_zones",
|
|
1188
|
+
"updated_on": "example_updated_on",
|
|
1189
|
+
"cards": "example_cards",
|
|
1190
|
+
"dwells": "example_dwells",
|
|
1191
|
+
"requires_card": "example_requires_card",
|
|
1192
|
+
"geofence": "example_geofence",
|
|
1193
|
+
"supply_map": "example_supply_map",
|
|
1194
|
+
"extra_data": "example_extra_data"
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
generic_model_validation_test(LocationView, example_input)
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
def test_locationview_validation_with_invalid_data():
|
|
1201
|
+
"""Test validation failure for LocationView model with invalid data."""
|
|
1202
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1203
|
+
|
|
1204
|
+
with pytest.raises(ValidationError):
|
|
1205
|
+
LocationView.model_validate(invalid_input)
|
|
1206
|
+
|
|
1207
|
+
def test_marketschemasectorview_validation():
|
|
1208
|
+
"""Test validation for MarketSchemaSectorView model."""
|
|
1209
|
+
example_input = {
|
|
1210
|
+
"root": "example_root"
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
generic_model_validation_test(MarketSchemaSectorView, example_input)
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
def test_marketschemasectorview_validation_with_invalid_data():
|
|
1217
|
+
"""Test validation failure for MarketSchemaSectorView model with invalid data."""
|
|
1218
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1219
|
+
|
|
1220
|
+
with pytest.raises(ValidationError):
|
|
1221
|
+
MarketSchemaSectorView.model_validate(invalid_input)
|
|
1222
|
+
|
|
1223
|
+
def test_marketview_validation():
|
|
1224
|
+
"""Test validation for MarketView model."""
|
|
1225
|
+
example_input = {
|
|
1226
|
+
"id": "example_id",
|
|
1227
|
+
"name": "example_name",
|
|
1228
|
+
"network_radius": "example_network_radius",
|
|
1229
|
+
"active": "example_active",
|
|
1230
|
+
"trailer_config": "example_trailer_config",
|
|
1231
|
+
"updated_on": "example_updated_on",
|
|
1232
|
+
"extra_data": "example_extra_data",
|
|
1233
|
+
"sectors": "example_sectors",
|
|
1234
|
+
"delivery_window_default": "example_delivery_window_default"
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
generic_model_validation_test(MarketView, example_input)
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
def test_marketview_validation_with_invalid_data():
|
|
1241
|
+
"""Test validation failure for MarketView model with invalid data."""
|
|
1242
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1243
|
+
|
|
1244
|
+
with pytest.raises(ValidationError):
|
|
1245
|
+
MarketView.model_validate(invalid_input)
|
|
1246
|
+
|
|
1247
|
+
def test_monitoringstrategy_validation():
|
|
1248
|
+
"""Test validation for MonitoringStrategy model."""
|
|
1249
|
+
example_input = {
|
|
1250
|
+
"root": "example_root"
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
generic_model_validation_test(MonitoringStrategy, example_input)
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
def test_monitoringstrategy_validation_with_invalid_data():
|
|
1257
|
+
"""Test validation failure for MonitoringStrategy model with invalid data."""
|
|
1258
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1259
|
+
|
|
1260
|
+
with pytest.raises(ValidationError):
|
|
1261
|
+
MonitoringStrategy.model_validate(invalid_input)
|
|
1262
|
+
|
|
1263
|
+
def test_nosupplyoptionresponse_validation():
|
|
1264
|
+
"""Test validation for NOSupplyOptionResponse model."""
|
|
1265
|
+
example_input = {
|
|
1266
|
+
"root": "example_root"
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
generic_model_validation_test(NOSupplyOptionResponse, example_input)
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
def test_nosupplyoptionresponse_validation_with_invalid_data():
|
|
1273
|
+
"""Test validation failure for NOSupplyOptionResponse model with invalid data."""
|
|
1274
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1275
|
+
|
|
1276
|
+
with pytest.raises(ValidationError):
|
|
1277
|
+
NOSupplyOptionResponse.model_validate(invalid_input)
|
|
1278
|
+
|
|
1279
|
+
def test_optimalsupplyreportrequest_validation():
|
|
1280
|
+
"""Test validation for OptimalSupplyReportRequest model."""
|
|
1281
|
+
example_input = {
|
|
1282
|
+
"order_numbers": "example_order_numbers",
|
|
1283
|
+
"order_ids": "example_order_ids",
|
|
1284
|
+
"order_date_start": "example_order_date_start",
|
|
1285
|
+
"order_date_end": "example_order_date_end",
|
|
1286
|
+
"movement_updated_start": "example_movement_updated_start",
|
|
1287
|
+
"movement_updated_end": "example_movement_updated_end",
|
|
1288
|
+
"last_change_date": "example_last_change_date"
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
generic_model_validation_test(OptimalSupplyReportRequest, example_input)
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
def test_optimalsupplyreportrequest_validation_with_invalid_data():
|
|
1295
|
+
"""Test validation failure for OptimalSupplyReportRequest model with invalid data."""
|
|
1296
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1297
|
+
|
|
1298
|
+
with pytest.raises(ValidationError):
|
|
1299
|
+
OptimalSupplyReportRequest.model_validate(invalid_input)
|
|
1300
|
+
|
|
1301
|
+
def test_optimalsupplyreportrow_validation():
|
|
1302
|
+
"""Test validation for OptimalSupplyReportRow model."""
|
|
1303
|
+
example_input = {
|
|
1304
|
+
"order_number": 42,
|
|
1305
|
+
"order_id": "example_order_id",
|
|
1306
|
+
"site_number": "example_site_number",
|
|
1307
|
+
"actual_component_product": "example_actual_component_product",
|
|
1308
|
+
"actual_component_product_id": "example_actual_component_product_id",
|
|
1309
|
+
"optimal_component_product": "example_optimal_component_product",
|
|
1310
|
+
"optimal_component_product_id": "example_optimal_component_product_id",
|
|
1311
|
+
"actual_terminal": "example_actual_terminal",
|
|
1312
|
+
"actual_terminal_id": "example_actual_terminal_id",
|
|
1313
|
+
"optimal_terminal": "example_optimal_terminal",
|
|
1314
|
+
"optimal_terminal_id": "example_optimal_terminal_id",
|
|
1315
|
+
"actual_supplier": "example_actual_supplier",
|
|
1316
|
+
"actual_supplier_id": "example_actual_supplier_id",
|
|
1317
|
+
"optimal_supplier": "example_optimal_supplier",
|
|
1318
|
+
"optimal_supplier_id": "example_optimal_supplier_id",
|
|
1319
|
+
"actual_price_type": "example_actual_price_type",
|
|
1320
|
+
"optimal_price_type": "example_optimal_price_type",
|
|
1321
|
+
"actual_contract": "example_actual_contract",
|
|
1322
|
+
"optimal_contract": "example_optimal_contract",
|
|
1323
|
+
"actual_curve_id": "example_actual_curve_id",
|
|
1324
|
+
"optimal_curve_id": "example_optimal_curve_id",
|
|
1325
|
+
"actual_price_id": "example_actual_price_id",
|
|
1326
|
+
"optimal_price_id": "example_optimal_price_id",
|
|
1327
|
+
"actual_loaded_miles": 3.14,
|
|
1328
|
+
"optimal_loaded_miles": 3.14,
|
|
1329
|
+
"actual_product_price": 3.14,
|
|
1330
|
+
"optimal_product_price": 3.14,
|
|
1331
|
+
"actual_freight_rate": 3.14,
|
|
1332
|
+
"optimal_freight_rate": 3.14,
|
|
1333
|
+
"actual_total_price": 3.14,
|
|
1334
|
+
"optimal_total_price": 3.14,
|
|
1335
|
+
"total_price_delta": 3.14,
|
|
1336
|
+
"actual_volume": 3.14,
|
|
1337
|
+
"optimal_volume": 3.14,
|
|
1338
|
+
"last_change_date": "example_last_change_date",
|
|
1339
|
+
"last_updated_date": "example_last_updated_date",
|
|
1340
|
+
"reason_code": "example_reason_code"
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
generic_model_validation_test(OptimalSupplyReportRow, example_input)
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
def test_optimalsupplyreportrow_validation_with_invalid_data():
|
|
1347
|
+
"""Test validation failure for OptimalSupplyReportRow model with invalid data."""
|
|
1348
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1349
|
+
|
|
1350
|
+
with pytest.raises(ValidationError):
|
|
1351
|
+
OptimalSupplyReportRow.model_validate(invalid_input)
|
|
1352
|
+
|
|
1353
|
+
def test_ordercreaterequest_validation():
|
|
1354
|
+
"""Test validation for OrderCreateRequest model."""
|
|
1355
|
+
example_input = {
|
|
1356
|
+
"reference_order_number": "example_reference_order_number",
|
|
1357
|
+
"supply_owner": "example_supply_owner",
|
|
1358
|
+
"sourcing_strategy": "example_sourcing_strategy",
|
|
1359
|
+
"manual_supply_fallback": "example_manual_supply_fallback",
|
|
1360
|
+
"allow_alternate_products": "example_allow_alternate_products",
|
|
1361
|
+
"delivery_window": "example_delivery_window",
|
|
1362
|
+
"fit_to_trailer": "example_fit_to_trailer",
|
|
1363
|
+
"note": "example_note",
|
|
1364
|
+
"drops": "example_drops",
|
|
1365
|
+
"accept_by": "example_accept_by",
|
|
1366
|
+
"extra_data": "example_extra_data"
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
generic_model_validation_test(OrderCreateRequest, example_input)
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
def test_ordercreaterequest_validation_with_invalid_data():
|
|
1373
|
+
"""Test validation failure for OrderCreateRequest model with invalid data."""
|
|
1374
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1375
|
+
|
|
1376
|
+
with pytest.raises(ValidationError):
|
|
1377
|
+
OrderCreateRequest.model_validate(invalid_input)
|
|
1378
|
+
|
|
1379
|
+
def test_ordercreateresponse_validation():
|
|
1380
|
+
"""Test validation for OrderCreateResponse model."""
|
|
1381
|
+
example_input = {
|
|
1382
|
+
"status": "example_status",
|
|
1383
|
+
"order_number": "example_order_number",
|
|
1384
|
+
"order": "example_order",
|
|
1385
|
+
"errors": "example_errors",
|
|
1386
|
+
"accept_by": "example_accept_by",
|
|
1387
|
+
"reference_order_number": "example_reference_order_number",
|
|
1388
|
+
"extra_data": "example_extra_data"
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
generic_model_validation_test(OrderCreateResponse, example_input)
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
def test_ordercreateresponse_validation_with_invalid_data():
|
|
1395
|
+
"""Test validation failure for OrderCreateResponse model with invalid data."""
|
|
1396
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1397
|
+
|
|
1398
|
+
with pytest.raises(ValidationError):
|
|
1399
|
+
OrderCreateResponse.model_validate(invalid_input)
|
|
1400
|
+
|
|
1401
|
+
def test_ordercreatestatus_validation():
|
|
1402
|
+
"""Test validation for OrderCreateStatus model."""
|
|
1403
|
+
example_input = {
|
|
1404
|
+
"root": "example_root"
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
generic_model_validation_test(OrderCreateStatus, example_input)
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
def test_ordercreatestatus_validation_with_invalid_data():
|
|
1411
|
+
"""Test validation failure for OrderCreateStatus model with invalid data."""
|
|
1412
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1413
|
+
|
|
1414
|
+
with pytest.raises(ValidationError):
|
|
1415
|
+
OrderCreateStatus.model_validate(invalid_input)
|
|
1416
|
+
|
|
1417
|
+
def test_orderdriver_validation():
|
|
1418
|
+
"""Test validation for OrderDriver model."""
|
|
1419
|
+
example_input = {
|
|
1420
|
+
"root": "example_root"
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
generic_model_validation_test(OrderDriver, example_input)
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
def test_orderdriver_validation_with_invalid_data():
|
|
1427
|
+
"""Test validation failure for OrderDriver model with invalid data."""
|
|
1428
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1429
|
+
|
|
1430
|
+
with pytest.raises(ValidationError):
|
|
1431
|
+
OrderDriver.model_validate(invalid_input)
|
|
1432
|
+
|
|
1433
|
+
def test_orderfreightresp_validation():
|
|
1434
|
+
"""Test validation for OrderFreightResp model."""
|
|
1435
|
+
example_input = {
|
|
1436
|
+
"number": 42,
|
|
1437
|
+
"po": "example_po",
|
|
1438
|
+
"freight_rate": 3.14,
|
|
1439
|
+
"freight_total": 3.14,
|
|
1440
|
+
"freight_items": "example_freight_items"
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
generic_model_validation_test(OrderFreightResp, example_input)
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
def test_orderfreightresp_validation_with_invalid_data():
|
|
1447
|
+
"""Test validation failure for OrderFreightResp model with invalid data."""
|
|
1448
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1449
|
+
|
|
1450
|
+
with pytest.raises(ValidationError):
|
|
1451
|
+
OrderFreightResp.model_validate(invalid_input)
|
|
1452
|
+
|
|
1453
|
+
def test_orderfreightrespv2_validation():
|
|
1454
|
+
"""Test validation for OrderFreightRespV2 model."""
|
|
1455
|
+
example_input = {
|
|
1456
|
+
"number": 42,
|
|
1457
|
+
"po": "example_po",
|
|
1458
|
+
"freight_rate": 3.14,
|
|
1459
|
+
"freight_total": 3.14,
|
|
1460
|
+
"freight_items": "example_freight_items"
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
generic_model_validation_test(OrderFreightRespV2, example_input)
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
def test_orderfreightrespv2_validation_with_invalid_data():
|
|
1467
|
+
"""Test validation failure for OrderFreightRespV2 model with invalid data."""
|
|
1468
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1469
|
+
|
|
1470
|
+
with pytest.raises(ValidationError):
|
|
1471
|
+
OrderFreightRespV2.model_validate(invalid_input)
|
|
1472
|
+
|
|
1473
|
+
def test_orderreqnotificationstates_validation():
|
|
1474
|
+
"""Test validation for OrderReqNotificationStates model."""
|
|
1475
|
+
example_input = {
|
|
1476
|
+
"root": "example_root"
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
generic_model_validation_test(OrderReqNotificationStates, example_input)
|
|
1480
|
+
|
|
1481
|
+
|
|
1482
|
+
def test_orderreqnotificationstates_validation_with_invalid_data():
|
|
1483
|
+
"""Test validation failure for OrderReqNotificationStates model with invalid data."""
|
|
1484
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1485
|
+
|
|
1486
|
+
with pytest.raises(ValidationError):
|
|
1487
|
+
OrderReqNotificationStates.model_validate(invalid_input)
|
|
1488
|
+
|
|
1489
|
+
def test_orderresponse_validation():
|
|
1490
|
+
"""Test validation for OrderResponse model."""
|
|
1491
|
+
example_input = {
|
|
1492
|
+
"root": "example_root"
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
generic_model_validation_test(OrderResponse, example_input)
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
def test_orderresponse_validation_with_invalid_data():
|
|
1499
|
+
"""Test validation failure for OrderResponse model with invalid data."""
|
|
1500
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1501
|
+
|
|
1502
|
+
with pytest.raises(ValidationError):
|
|
1503
|
+
OrderResponse.model_validate(invalid_input)
|
|
1504
|
+
|
|
1505
|
+
def test_orderschemabolresponse_validation():
|
|
1506
|
+
"""Test validation for OrderSchemaBolResponse model."""
|
|
1507
|
+
example_input = {
|
|
1508
|
+
"root": "example_root"
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
generic_model_validation_test(OrderSchemaBolResponse, example_input)
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
def test_orderschemabolresponse_validation_with_invalid_data():
|
|
1515
|
+
"""Test validation failure for OrderSchemaBolResponse model with invalid data."""
|
|
1516
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1517
|
+
|
|
1518
|
+
with pytest.raises(ValidationError):
|
|
1519
|
+
OrderSchemaBolResponse.model_validate(invalid_input)
|
|
1520
|
+
|
|
1521
|
+
def test_orderschemadropresponse_validation():
|
|
1522
|
+
"""Test validation for OrderSchemaDropResponse model."""
|
|
1523
|
+
example_input = {
|
|
1524
|
+
"root": "example_root"
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
generic_model_validation_test(OrderSchemaDropResponse, example_input)
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
def test_orderschemadropresponse_validation_with_invalid_data():
|
|
1531
|
+
"""Test validation failure for OrderSchemaDropResponse model with invalid data."""
|
|
1532
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1533
|
+
|
|
1534
|
+
with pytest.raises(ValidationError):
|
|
1535
|
+
OrderSchemaDropResponse.model_validate(invalid_input)
|
|
1536
|
+
|
|
1537
|
+
def test_orderstate_validation():
|
|
1538
|
+
"""Test validation for OrderState model."""
|
|
1539
|
+
example_input = {
|
|
1540
|
+
"root": "example_root"
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
generic_model_validation_test(OrderState, example_input)
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
def test_orderstate_validation_with_invalid_data():
|
|
1547
|
+
"""Test validation failure for OrderState model with invalid data."""
|
|
1548
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1549
|
+
|
|
1550
|
+
with pytest.raises(ValidationError):
|
|
1551
|
+
OrderState.model_validate(invalid_input)
|
|
1552
|
+
|
|
1553
|
+
def test_orderstatusupdaterequest_validation():
|
|
1554
|
+
"""Test validation for OrderStatusUpdateRequest model."""
|
|
1555
|
+
example_input = {
|
|
1556
|
+
"order_id": "example_order_id",
|
|
1557
|
+
"order_number": "example_order_number",
|
|
1558
|
+
"status": "example_status",
|
|
1559
|
+
"location_id": "example_location_id",
|
|
1560
|
+
"eta": "example_eta",
|
|
1561
|
+
"actual": "example_actual"
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
generic_model_validation_test(OrderStatusUpdateRequest, example_input)
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
def test_orderstatusupdaterequest_validation_with_invalid_data():
|
|
1568
|
+
"""Test validation failure for OrderStatusUpdateRequest model with invalid data."""
|
|
1569
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1570
|
+
|
|
1571
|
+
with pytest.raises(ValidationError):
|
|
1572
|
+
OrderStatusUpdateRequest.model_validate(invalid_input)
|
|
1573
|
+
|
|
1574
|
+
def test_ordertype_validation():
|
|
1575
|
+
"""Test validation for OrderType model."""
|
|
1576
|
+
example_input = {
|
|
1577
|
+
"root": "example_root"
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
generic_model_validation_test(OrderType, example_input)
|
|
1581
|
+
|
|
1582
|
+
|
|
1583
|
+
def test_ordertype_validation_with_invalid_data():
|
|
1584
|
+
"""Test validation failure for OrderType model with invalid data."""
|
|
1585
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1586
|
+
|
|
1587
|
+
with pytest.raises(ValidationError):
|
|
1588
|
+
OrderType.model_validate(invalid_input)
|
|
1589
|
+
|
|
1590
|
+
def test_payrollexportdetailmodel_validation():
|
|
1591
|
+
"""Test validation for PayrollExportDetailModel model."""
|
|
1592
|
+
example_input = {
|
|
1593
|
+
"root": "example_root"
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
generic_model_validation_test(PayrollExportDetailModel, example_input)
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
def test_payrollexportdetailmodel_validation_with_invalid_data():
|
|
1600
|
+
"""Test validation failure for PayrollExportDetailModel model with invalid data."""
|
|
1601
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1602
|
+
|
|
1603
|
+
with pytest.raises(ValidationError):
|
|
1604
|
+
PayrollExportDetailModel.model_validate(invalid_input)
|
|
1605
|
+
|
|
1606
|
+
def test_payrollexportdetailresponse_validation():
|
|
1607
|
+
"""Test validation for PayrollExportDetailResponse model."""
|
|
1608
|
+
example_input = {
|
|
1609
|
+
"driver_name": "example_driver_name",
|
|
1610
|
+
"driver_source_id": "example_driver_source_id",
|
|
1611
|
+
"driver_source_system": "example_driver_source_system",
|
|
1612
|
+
"end_date": "example_end_date",
|
|
1613
|
+
"hours_worked": 3.14,
|
|
1614
|
+
"pay_earned": 3.14,
|
|
1615
|
+
"payroll_config": "example_payroll_config",
|
|
1616
|
+
"start_date": "example_start_date",
|
|
1617
|
+
"status": "example_status",
|
|
1618
|
+
"updated": "example_updated",
|
|
1619
|
+
"detail": "example_detail"
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
generic_model_validation_test(PayrollExportDetailResponse, example_input)
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
def test_payrollexportdetailresponse_validation_with_invalid_data():
|
|
1626
|
+
"""Test validation failure for PayrollExportDetailResponse model with invalid data."""
|
|
1627
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1628
|
+
|
|
1629
|
+
with pytest.raises(ValidationError):
|
|
1630
|
+
PayrollExportDetailResponse.model_validate(invalid_input)
|
|
1631
|
+
|
|
1632
|
+
def test_priceallrequest_validation():
|
|
1633
|
+
"""Test validation for PriceAllRequest model."""
|
|
1634
|
+
example_input = {
|
|
1635
|
+
"as_of": "example_as_of",
|
|
1636
|
+
"last_change_date": "example_last_change_date",
|
|
1637
|
+
"terminals": "example_terminals",
|
|
1638
|
+
"suppliers": "example_suppliers",
|
|
1639
|
+
"products": "example_products",
|
|
1640
|
+
"price_types": "example_price_types",
|
|
1641
|
+
"product_groups": "example_product_groups"
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
generic_model_validation_test(PriceAllRequest, example_input)
|
|
1645
|
+
|
|
1646
|
+
|
|
1647
|
+
def test_priceallrequest_validation_with_invalid_data():
|
|
1648
|
+
"""Test validation failure for PriceAllRequest model with invalid data."""
|
|
1649
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1650
|
+
|
|
1651
|
+
with pytest.raises(ValidationError):
|
|
1652
|
+
PriceAllRequest.model_validate(invalid_input)
|
|
1653
|
+
|
|
1654
|
+
def test_priceresponse_validation():
|
|
1655
|
+
"""Test validation for PriceResponse model."""
|
|
1656
|
+
example_input = {
|
|
1657
|
+
"curve_id": "example_curve_id",
|
|
1658
|
+
"price_id": "example_price_id",
|
|
1659
|
+
"city": "example_city",
|
|
1660
|
+
"contract": "example_contract",
|
|
1661
|
+
"product": "example_product",
|
|
1662
|
+
"product_id": "example_product_id",
|
|
1663
|
+
"supplier": "example_supplier",
|
|
1664
|
+
"supplier_id": "example_supplier_id",
|
|
1665
|
+
"counterparty": "example_counterparty",
|
|
1666
|
+
"counterparty_id": "example_counterparty_id",
|
|
1667
|
+
"terminal": "example_terminal",
|
|
1668
|
+
"terminal_id": "example_terminal_id",
|
|
1669
|
+
"store_number": "example_store_number",
|
|
1670
|
+
"store_id": "example_store_id",
|
|
1671
|
+
"price_type": "example_price_type",
|
|
1672
|
+
"product_group": "example_product_group",
|
|
1673
|
+
"price": 3.14,
|
|
1674
|
+
"effective_from": "example_effective_from",
|
|
1675
|
+
"effective_to": "example_effective_to",
|
|
1676
|
+
"expire": "example_expire",
|
|
1677
|
+
"disabled": true,
|
|
1678
|
+
"disabled_by": "example_disabled_by",
|
|
1679
|
+
"disabled_until": "example_disabled_until",
|
|
1680
|
+
"disabled_reason": "example_disabled_reason",
|
|
1681
|
+
"updated_by": "example_updated_by",
|
|
1682
|
+
"updated_on": "example_updated_on",
|
|
1683
|
+
"extra_data": "example_extra_data",
|
|
1684
|
+
"group_id": "example_group_id",
|
|
1685
|
+
"group_effective_cutover": "example_group_effective_cutover",
|
|
1686
|
+
"group_effective_cutover_timezone": "example_group_effective_cutover_timezone",
|
|
1687
|
+
"group_identifier": "example_group_identifier",
|
|
1688
|
+
"group_name": "example_group_name",
|
|
1689
|
+
"min_constraint": "example_min_constraint",
|
|
1690
|
+
"max_constraint": "example_max_constraint",
|
|
1691
|
+
"created_on": "example_created_on",
|
|
1692
|
+
"net_or_gross_type": "example_net_or_gross_type",
|
|
1693
|
+
"contract_lifting_valuation_method": "example_contract_lifting_valuation_method"
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
generic_model_validation_test(PriceResponse, example_input)
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
def test_priceresponse_validation_with_invalid_data():
|
|
1700
|
+
"""Test validation failure for PriceResponse model with invalid data."""
|
|
1701
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1702
|
+
|
|
1703
|
+
with pytest.raises(ValidationError):
|
|
1704
|
+
PriceResponse.model_validate(invalid_input)
|
|
1705
|
+
|
|
1706
|
+
def test_pricetype_validation():
|
|
1707
|
+
"""Test validation for PriceType model."""
|
|
1708
|
+
example_input = {
|
|
1709
|
+
"root": "example_root"
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
generic_model_validation_test(PriceType, example_input)
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
def test_pricetype_validation_with_invalid_data():
|
|
1716
|
+
"""Test validation failure for PriceType model with invalid data."""
|
|
1717
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1718
|
+
|
|
1719
|
+
with pytest.raises(ValidationError):
|
|
1720
|
+
PriceType.model_validate(invalid_input)
|
|
1721
|
+
|
|
1722
|
+
def test_productgroups_validation():
|
|
1723
|
+
"""Test validation for ProductGroups model."""
|
|
1724
|
+
example_input = {
|
|
1725
|
+
"root": "example_root"
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
generic_model_validation_test(ProductGroups, example_input)
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
def test_productgroups_validation_with_invalid_data():
|
|
1732
|
+
"""Test validation failure for ProductGroups model with invalid data."""
|
|
1733
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1734
|
+
|
|
1735
|
+
with pytest.raises(ValidationError):
|
|
1736
|
+
ProductGroups.model_validate(invalid_input)
|
|
1737
|
+
|
|
1738
|
+
def test_productidname_validation():
|
|
1739
|
+
"""Test validation for ProductIDName model."""
|
|
1740
|
+
example_input = {
|
|
1741
|
+
"root": "example_root"
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
generic_model_validation_test(ProductIDName, example_input)
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
def test_productidname_validation_with_invalid_data():
|
|
1748
|
+
"""Test validation failure for ProductIDName model with invalid data."""
|
|
1749
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1750
|
+
|
|
1751
|
+
with pytest.raises(ValidationError):
|
|
1752
|
+
ProductIDName.model_validate(invalid_input)
|
|
1753
|
+
|
|
1754
|
+
def test_productview_validation():
|
|
1755
|
+
"""Test validation for ProductView model."""
|
|
1756
|
+
example_input = {
|
|
1757
|
+
"id": "example_id",
|
|
1758
|
+
"name": "example_name",
|
|
1759
|
+
"short_name": "example_short_name",
|
|
1760
|
+
"group": "example_group",
|
|
1761
|
+
"weight_group": "example_weight_group",
|
|
1762
|
+
"icon": "example_icon",
|
|
1763
|
+
"source_id": "example_source_id",
|
|
1764
|
+
"source_system": "example_source_system",
|
|
1765
|
+
"source_system_id": "example_source_system_id",
|
|
1766
|
+
"extra_data": "example_extra_data",
|
|
1767
|
+
"blends": "example_blends",
|
|
1768
|
+
"alternate_products": "example_alternate_products",
|
|
1769
|
+
"updated_on": "example_updated_on",
|
|
1770
|
+
"tank_lid_code_id": "example_tank_lid_code_id",
|
|
1771
|
+
"supply_map": "example_supply_map"
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
generic_model_validation_test(ProductView, example_input)
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
def test_productview_validation_with_invalid_data():
|
|
1778
|
+
"""Test validation failure for ProductView model with invalid data."""
|
|
1779
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1780
|
+
|
|
1781
|
+
with pytest.raises(ValidationError):
|
|
1782
|
+
ProductView.model_validate(invalid_input)
|
|
1783
|
+
|
|
1784
|
+
def test_pydanticobjectid_validation():
|
|
1785
|
+
"""Test validation for PydanticObjectId model."""
|
|
1786
|
+
example_input = {
|
|
1787
|
+
"root": "example_root"
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
generic_model_validation_test(PydanticObjectId, example_input)
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
def test_pydanticobjectid_validation_with_invalid_data():
|
|
1794
|
+
"""Test validation failure for PydanticObjectId model with invalid data."""
|
|
1795
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1796
|
+
|
|
1797
|
+
with pytest.raises(ValidationError):
|
|
1798
|
+
PydanticObjectId.model_validate(invalid_input)
|
|
1799
|
+
|
|
1800
|
+
def test_ratebooktype_validation():
|
|
1801
|
+
"""Test validation for RateBookType model."""
|
|
1802
|
+
example_input = {
|
|
1803
|
+
"root": "example_root"
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
generic_model_validation_test(RateBookType, example_input)
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
def test_ratebooktype_validation_with_invalid_data():
|
|
1810
|
+
"""Test validation failure for RateBookType model with invalid data."""
|
|
1811
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1812
|
+
|
|
1813
|
+
with pytest.raises(ValidationError):
|
|
1814
|
+
RateBookType.model_validate(invalid_input)
|
|
1815
|
+
|
|
1816
|
+
def test_rootmodel_validation():
|
|
1817
|
+
"""Test validation for RootModel model."""
|
|
1818
|
+
example_input = {
|
|
1819
|
+
"root": "example_root"
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
generic_model_validation_test(RootModel, example_input)
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
def test_rootmodel_validation_with_invalid_data():
|
|
1826
|
+
"""Test validation failure for RootModel model with invalid data."""
|
|
1827
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1828
|
+
|
|
1829
|
+
with pytest.raises(ValidationError):
|
|
1830
|
+
RootModel.model_validate(invalid_input)
|
|
1831
|
+
|
|
1832
|
+
def test_routeupsertreq_validation():
|
|
1833
|
+
"""Test validation for RouteUpsertReq model."""
|
|
1834
|
+
example_input = {
|
|
1835
|
+
"origin_name": "example_origin_name",
|
|
1836
|
+
"destination_name": "example_destination_name",
|
|
1837
|
+
"api_distance_miles": "example_api_distance_miles",
|
|
1838
|
+
"api_travel_time_seconds": "example_api_travel_time_seconds",
|
|
1839
|
+
"override_travel_time_seconds": "example_override_travel_time_seconds",
|
|
1840
|
+
"override_distance_miles": "example_override_distance_miles",
|
|
1841
|
+
"override_payroll_miles": "example_override_payroll_miles"
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
generic_model_validation_test(RouteUpsertReq, example_input)
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
def test_routeupsertreq_validation_with_invalid_data():
|
|
1848
|
+
"""Test validation failure for RouteUpsertReq model with invalid data."""
|
|
1849
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1850
|
+
|
|
1851
|
+
with pytest.raises(ValidationError):
|
|
1852
|
+
RouteUpsertReq.model_validate(invalid_input)
|
|
1853
|
+
|
|
1854
|
+
def test_salesadjusteddeliveryupsertreq_validation():
|
|
1855
|
+
"""Test validation for SalesAdjustedDeliveryUpsertReq model."""
|
|
1856
|
+
example_input = {
|
|
1857
|
+
"source": "example_source",
|
|
1858
|
+
"store_id": "example_store_id",
|
|
1859
|
+
"tank_id": "example_tank_id",
|
|
1860
|
+
"product_id": "example_product_id",
|
|
1861
|
+
"volume": 3.14,
|
|
1862
|
+
"date": "example_date"
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
generic_model_validation_test(SalesAdjustedDeliveryUpsertReq, example_input)
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
def test_salesadjusteddeliveryupsertreq_validation_with_invalid_data():
|
|
1869
|
+
"""Test validation failure for SalesAdjustedDeliveryUpsertReq model with invalid data."""
|
|
1870
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1871
|
+
|
|
1872
|
+
with pytest.raises(ValidationError):
|
|
1873
|
+
SalesAdjustedDeliveryUpsertReq.model_validate(invalid_input)
|
|
1874
|
+
|
|
1875
|
+
def test_savedropdetail_validation():
|
|
1876
|
+
"""Test validation for SaveDropDetail model."""
|
|
1877
|
+
example_input = {
|
|
1878
|
+
"root": "example_root"
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
generic_model_validation_test(SaveDropDetail, example_input)
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
def test_savedropdetail_validation_with_invalid_data():
|
|
1885
|
+
"""Test validation failure for SaveDropDetail model with invalid data."""
|
|
1886
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1887
|
+
|
|
1888
|
+
with pytest.raises(ValidationError):
|
|
1889
|
+
SaveDropDetail.model_validate(invalid_input)
|
|
1890
|
+
|
|
1891
|
+
def test_savedropmode_validation():
|
|
1892
|
+
"""Test validation for SaveDropMode model."""
|
|
1893
|
+
example_input = {
|
|
1894
|
+
"root": "example_root"
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
generic_model_validation_test(SaveDropMode, example_input)
|
|
1898
|
+
|
|
1899
|
+
|
|
1900
|
+
def test_savedropmode_validation_with_invalid_data():
|
|
1901
|
+
"""Test validation failure for SaveDropMode model with invalid data."""
|
|
1902
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1903
|
+
|
|
1904
|
+
with pytest.raises(ValidationError):
|
|
1905
|
+
SaveDropMode.model_validate(invalid_input)
|
|
1906
|
+
|
|
1907
|
+
def test_savedropreq_validation():
|
|
1908
|
+
"""Test validation for SaveDropReq model."""
|
|
1909
|
+
example_input = {
|
|
1910
|
+
"mode": "example_mode",
|
|
1911
|
+
"order_id": "example_order_id",
|
|
1912
|
+
"location_id": "example_location_id",
|
|
1913
|
+
"details": "example_details"
|
|
1914
|
+
}
|
|
1915
|
+
|
|
1916
|
+
generic_model_validation_test(SaveDropReq, example_input)
|
|
1917
|
+
|
|
1918
|
+
|
|
1919
|
+
def test_savedropreq_validation_with_invalid_data():
|
|
1920
|
+
"""Test validation failure for SaveDropReq model with invalid data."""
|
|
1921
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1922
|
+
|
|
1923
|
+
with pytest.raises(ValidationError):
|
|
1924
|
+
SaveDropReq.model_validate(invalid_input)
|
|
1925
|
+
|
|
1926
|
+
def test_shift_validation():
|
|
1927
|
+
"""Test validation for Shift model."""
|
|
1928
|
+
example_input = {
|
|
1929
|
+
"root": "example_root"
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
generic_model_validation_test(Shift, example_input)
|
|
1933
|
+
|
|
1934
|
+
|
|
1935
|
+
def test_shift_validation_with_invalid_data():
|
|
1936
|
+
"""Test validation failure for Shift model with invalid data."""
|
|
1937
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1938
|
+
|
|
1939
|
+
with pytest.raises(ValidationError):
|
|
1940
|
+
Shift.model_validate(invalid_input)
|
|
1941
|
+
|
|
1942
|
+
def test_sourcemap_validation():
|
|
1943
|
+
"""Test validation for SourceMap model."""
|
|
1944
|
+
example_input = {
|
|
1945
|
+
"root": "example_root"
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
generic_model_validation_test(SourceMap, example_input)
|
|
1949
|
+
|
|
1950
|
+
|
|
1951
|
+
def test_sourcemap_validation_with_invalid_data():
|
|
1952
|
+
"""Test validation failure for SourceMap model with invalid data."""
|
|
1953
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1954
|
+
|
|
1955
|
+
with pytest.raises(ValidationError):
|
|
1956
|
+
SourceMap.model_validate(invalid_input)
|
|
1957
|
+
|
|
1958
|
+
def test_sourcingstrategy_validation():
|
|
1959
|
+
"""Test validation for SourcingStrategy model."""
|
|
1960
|
+
example_input = {
|
|
1961
|
+
"root": "example_root"
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
generic_model_validation_test(SourcingStrategy, example_input)
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
def test_sourcingstrategy_validation_with_invalid_data():
|
|
1968
|
+
"""Test validation failure for SourcingStrategy model with invalid data."""
|
|
1969
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1970
|
+
|
|
1971
|
+
with pytest.raises(ValidationError):
|
|
1972
|
+
SourcingStrategy.model_validate(invalid_input)
|
|
1973
|
+
|
|
1974
|
+
def test_statusupdate_validation():
|
|
1975
|
+
"""Test validation for StatusUpdate model."""
|
|
1976
|
+
example_input = {
|
|
1977
|
+
"root": "example_root"
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
generic_model_validation_test(StatusUpdate, example_input)
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
def test_statusupdate_validation_with_invalid_data():
|
|
1984
|
+
"""Test validation failure for StatusUpdate model with invalid data."""
|
|
1985
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
1986
|
+
|
|
1987
|
+
with pytest.raises(ValidationError):
|
|
1988
|
+
StatusUpdate.model_validate(invalid_input)
|
|
1989
|
+
|
|
1990
|
+
def test_storestatus_validation():
|
|
1991
|
+
"""Test validation for StoreStatus model."""
|
|
1992
|
+
example_input = {
|
|
1993
|
+
"root": "example_root"
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
generic_model_validation_test(StoreStatus, example_input)
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
def test_storestatus_validation_with_invalid_data():
|
|
2000
|
+
"""Test validation failure for StoreStatus model with invalid data."""
|
|
2001
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2002
|
+
|
|
2003
|
+
with pytest.raises(ValidationError):
|
|
2004
|
+
StoreStatus.model_validate(invalid_input)
|
|
2005
|
+
|
|
2006
|
+
def test_storetank_validation():
|
|
2007
|
+
"""Test validation for StoreTank model."""
|
|
2008
|
+
example_input = {
|
|
2009
|
+
"root": "example_root"
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
generic_model_validation_test(StoreTank, example_input)
|
|
2013
|
+
|
|
2014
|
+
|
|
2015
|
+
def test_storetank_validation_with_invalid_data():
|
|
2016
|
+
"""Test validation failure for StoreTank model with invalid data."""
|
|
2017
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2018
|
+
|
|
2019
|
+
with pytest.raises(ValidationError):
|
|
2020
|
+
StoreTank.model_validate(invalid_input)
|
|
2021
|
+
|
|
2022
|
+
def test_storev2_validation():
|
|
2023
|
+
"""Test validation for StoreV2 model."""
|
|
2024
|
+
example_input = {
|
|
2025
|
+
"field_id": "example_field_id",
|
|
2026
|
+
"store_number": "example_store_number",
|
|
2027
|
+
"name": "example_name",
|
|
2028
|
+
"market": "example_market",
|
|
2029
|
+
"market_id": "example_market_id",
|
|
2030
|
+
"sector": "example_sector",
|
|
2031
|
+
"sector_id": "example_sector_id",
|
|
2032
|
+
"tanks": "example_tanks",
|
|
2033
|
+
"lat": "example_lat",
|
|
2034
|
+
"lon": "example_lon",
|
|
2035
|
+
"address": "example_address",
|
|
2036
|
+
"city": "example_city",
|
|
2037
|
+
"state": "example_state",
|
|
2038
|
+
"postal_code": "example_postal_code",
|
|
2039
|
+
"contact_name": "example_contact_name",
|
|
2040
|
+
"phone_number": "example_phone_number",
|
|
2041
|
+
"emails": "example_emails",
|
|
2042
|
+
"hours": "example_hours",
|
|
2043
|
+
"timezone": "example_timezone",
|
|
2044
|
+
"status": "example_status",
|
|
2045
|
+
"drop_workflow": "example_drop_workflow",
|
|
2046
|
+
"open_date": "example_open_date",
|
|
2047
|
+
"close_date": "example_close_date",
|
|
2048
|
+
"unavailable_hours": "example_unavailable_hours",
|
|
2049
|
+
"counterparty_id": "example_counterparty_id",
|
|
2050
|
+
"counterparty_name": "example_counterparty_name",
|
|
2051
|
+
"in_network_terminals": "example_in_network_terminals",
|
|
2052
|
+
"in_network_supply_zones": "example_in_network_supply_zones",
|
|
2053
|
+
"supply_owner_id": "example_supply_owner_id",
|
|
2054
|
+
"supply_owner_name": "example_supply_owner_name",
|
|
2055
|
+
"freight_customer_id": "example_freight_customer_id",
|
|
2056
|
+
"freight_customer_name": "example_freight_customer_name",
|
|
2057
|
+
"freight_region_name": "example_freight_region_name",
|
|
2058
|
+
"freight_region_id": "example_freight_region_id",
|
|
2059
|
+
"layout_file": "example_layout_file",
|
|
2060
|
+
"layout_file_uploaded": "example_layout_file_uploaded",
|
|
2061
|
+
"auto_order_disabled": "example_auto_order_disabled",
|
|
2062
|
+
"updated_id": "example_updated_id",
|
|
2063
|
+
"trailer_config": "example_trailer_config",
|
|
2064
|
+
"monitoring_strategy": "example_monitoring_strategy",
|
|
2065
|
+
"estick_monitor_override": "example_estick_monitor_override",
|
|
2066
|
+
"notes": "example_notes",
|
|
2067
|
+
"updated_on": "example_updated_on",
|
|
2068
|
+
"updated_by": "example_updated_by",
|
|
2069
|
+
"extra_data": "example_extra_data",
|
|
2070
|
+
"credit_hold": "example_credit_hold",
|
|
2071
|
+
"compliance_hold_date": "example_compliance_hold_date",
|
|
2072
|
+
"delivery_window_default_name": "example_delivery_window_default_name",
|
|
2073
|
+
"delivery_window_default_id": "example_delivery_window_default_id",
|
|
2074
|
+
"allow_by_product_request": "example_allow_by_product_request",
|
|
2075
|
+
"geofence": "example_geofence"
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
generic_model_validation_test(StoreV2, example_input)
|
|
2079
|
+
|
|
2080
|
+
|
|
2081
|
+
def test_storev2_validation_with_invalid_data():
|
|
2082
|
+
"""Test validation failure for StoreV2 model with invalid data."""
|
|
2083
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2084
|
+
|
|
2085
|
+
with pytest.raises(ValidationError):
|
|
2086
|
+
StoreV2.model_validate(invalid_input)
|
|
2087
|
+
|
|
2088
|
+
def test_supplypriceupdatemanyrequest_validation():
|
|
2089
|
+
"""Test validation for SupplyPriceUpdateManyRequest model."""
|
|
2090
|
+
example_input = {
|
|
2091
|
+
"id": "example_id",
|
|
2092
|
+
"source_id": "example_source_id",
|
|
2093
|
+
"source_system_id": "example_source_system_id",
|
|
2094
|
+
"contract": "example_contract",
|
|
2095
|
+
"timezone": "example_timezone",
|
|
2096
|
+
"effective_from": "example_effective_from",
|
|
2097
|
+
"effective_to": "example_effective_to",
|
|
2098
|
+
"price": 3.14,
|
|
2099
|
+
"price_type": "example_price_type",
|
|
2100
|
+
"terminal_id": "example_terminal_id",
|
|
2101
|
+
"terminal_source_id": "example_terminal_source_id",
|
|
2102
|
+
"terminal_source_system_id": "example_terminal_source_system_id",
|
|
2103
|
+
"terminal": "example_terminal",
|
|
2104
|
+
"product_id": "example_product_id",
|
|
2105
|
+
"product_source_id": "example_product_source_id",
|
|
2106
|
+
"product_source_system_id": "example_product_source_system_id",
|
|
2107
|
+
"product": "example_product",
|
|
2108
|
+
"supplier_id": "example_supplier_id",
|
|
2109
|
+
"supplier_source_id": "example_supplier_source_id",
|
|
2110
|
+
"supplier_source_system_id": "example_supplier_source_system_id",
|
|
2111
|
+
"supplier": "example_supplier",
|
|
2112
|
+
"counterparty_id": "example_counterparty_id",
|
|
2113
|
+
"counterparty_source_id": "example_counterparty_source_id",
|
|
2114
|
+
"counterparty_source_system_id": "example_counterparty_source_system_id",
|
|
2115
|
+
"counterparty": "example_counterparty",
|
|
2116
|
+
"store_id": "example_store_id",
|
|
2117
|
+
"store_source_id": "example_store_source_id",
|
|
2118
|
+
"store_source_system_id": "example_store_source_system_id",
|
|
2119
|
+
"store_number": "example_store_number",
|
|
2120
|
+
"enabled": "example_enabled",
|
|
2121
|
+
"disabled_until": "example_disabled_until",
|
|
2122
|
+
"expire": "example_expire",
|
|
2123
|
+
"min_quantity": "example_min_quantity",
|
|
2124
|
+
"max_quantity": "example_max_quantity",
|
|
2125
|
+
"curve_id": "example_curve_id",
|
|
2126
|
+
"error": "example_error",
|
|
2127
|
+
"row": "example_row",
|
|
2128
|
+
"net_or_gross_type": "example_net_or_gross_type",
|
|
2129
|
+
"contract_lifting_valuation_method": "example_contract_lifting_valuation_method"
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
generic_model_validation_test(SupplyPriceUpdateManyRequest, example_input)
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
def test_supplypriceupdatemanyrequest_validation_with_invalid_data():
|
|
2136
|
+
"""Test validation failure for SupplyPriceUpdateManyRequest model with invalid data."""
|
|
2137
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2138
|
+
|
|
2139
|
+
with pytest.raises(ValidationError):
|
|
2140
|
+
SupplyPriceUpdateManyRequest.model_validate(invalid_input)
|
|
2141
|
+
|
|
2142
|
+
def test_supplypriceupdateresponse_validation():
|
|
2143
|
+
"""Test validation for SupplyPriceUpdateResponse model."""
|
|
2144
|
+
example_input = {
|
|
2145
|
+
"root": "example_root"
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
generic_model_validation_test(SupplyPriceUpdateResponse, example_input)
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
def test_supplypriceupdateresponse_validation_with_invalid_data():
|
|
2152
|
+
"""Test validation failure for SupplyPriceUpdateResponse model with invalid data."""
|
|
2153
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2154
|
+
|
|
2155
|
+
with pytest.raises(ValidationError):
|
|
2156
|
+
SupplyPriceUpdateResponse.model_validate(invalid_input)
|
|
2157
|
+
|
|
2158
|
+
def test_surchargeallreq_validation():
|
|
2159
|
+
"""Test validation for SurchargeAllReq model."""
|
|
2160
|
+
example_input = {
|
|
2161
|
+
"counterparty_name": "example_counterparty_name",
|
|
2162
|
+
"counterparty_id": "example_counterparty_id",
|
|
2163
|
+
"book_type": "example_book_type",
|
|
2164
|
+
"as_of": "example_as_of",
|
|
2165
|
+
"product_group": "example_product_group",
|
|
2166
|
+
"freight_region_name": "example_freight_region_name",
|
|
2167
|
+
"freight_region_id": "example_freight_region_id"
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
generic_model_validation_test(SurchargeAllReq, example_input)
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
def test_surchargeallreq_validation_with_invalid_data():
|
|
2174
|
+
"""Test validation failure for SurchargeAllReq model with invalid data."""
|
|
2175
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2176
|
+
|
|
2177
|
+
with pytest.raises(ValidationError):
|
|
2178
|
+
SurchargeAllReq.model_validate(invalid_input)
|
|
2179
|
+
|
|
2180
|
+
def test_surchargeallresp_validation():
|
|
2181
|
+
"""Test validation for SurchargeAllResp model."""
|
|
2182
|
+
example_input = {
|
|
2183
|
+
"id": "example_id",
|
|
2184
|
+
"counterparty": "example_counterparty",
|
|
2185
|
+
"counterparty_id": "example_counterparty_id",
|
|
2186
|
+
"product_group": "example_product_group",
|
|
2187
|
+
"book_type": "example_book_type",
|
|
2188
|
+
"freight_region_id": "example_freight_region_id",
|
|
2189
|
+
"freight_region_name": "example_freight_region_name",
|
|
2190
|
+
"type": "example_type",
|
|
2191
|
+
"effective_from": "example_effective_from",
|
|
2192
|
+
"effective_to": "example_effective_to",
|
|
2193
|
+
"surcharge": "example_surcharge",
|
|
2194
|
+
"created_on": "example_created_on",
|
|
2195
|
+
"created_by": "example_created_by"
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
generic_model_validation_test(SurchargeAllResp, example_input)
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
def test_surchargeallresp_validation_with_invalid_data():
|
|
2202
|
+
"""Test validation failure for SurchargeAllResp model with invalid data."""
|
|
2203
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2204
|
+
|
|
2205
|
+
with pytest.raises(ValidationError):
|
|
2206
|
+
SurchargeAllResp.model_validate(invalid_input)
|
|
2207
|
+
|
|
2208
|
+
def test_surchargecreatereq_validation():
|
|
2209
|
+
"""Test validation for SurchargeCreateReq model."""
|
|
2210
|
+
example_input = {
|
|
2211
|
+
"counterparty_name": "example_counterparty_name",
|
|
2212
|
+
"counterparty_id": "example_counterparty_id",
|
|
2213
|
+
"product_group": "example_product_group",
|
|
2214
|
+
"book_type": "example_book_type",
|
|
2215
|
+
"freight_region_id": "example_freight_region_id",
|
|
2216
|
+
"freight_region_name": "example_freight_region_name",
|
|
2217
|
+
"type": "example_type",
|
|
2218
|
+
"effective_from": "example_effective_from",
|
|
2219
|
+
"effective_to": "example_effective_to",
|
|
2220
|
+
"surcharge": "example_surcharge"
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
generic_model_validation_test(SurchargeCreateReq, example_input)
|
|
2224
|
+
|
|
2225
|
+
|
|
2226
|
+
def test_surchargecreatereq_validation_with_invalid_data():
|
|
2227
|
+
"""Test validation failure for SurchargeCreateReq model with invalid data."""
|
|
2228
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2229
|
+
|
|
2230
|
+
with pytest.raises(ValidationError):
|
|
2231
|
+
SurchargeCreateReq.model_validate(invalid_input)
|
|
2232
|
+
|
|
2233
|
+
def test_surchargetype_validation():
|
|
2234
|
+
"""Test validation for SurchargeType model."""
|
|
2235
|
+
example_input = {
|
|
2236
|
+
"root": "example_root"
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
generic_model_validation_test(SurchargeType, example_input)
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
def test_surchargetype_validation_with_invalid_data():
|
|
2243
|
+
"""Test validation failure for SurchargeType model with invalid data."""
|
|
2244
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2245
|
+
|
|
2246
|
+
with pytest.raises(ValidationError):
|
|
2247
|
+
SurchargeType.model_validate(invalid_input)
|
|
2248
|
+
|
|
2249
|
+
def test_surchargeupdatereq_validation():
|
|
2250
|
+
"""Test validation for SurchargeUpdateReq model."""
|
|
2251
|
+
example_input = {
|
|
2252
|
+
"id": "example_id",
|
|
2253
|
+
"effective_from": "example_effective_from",
|
|
2254
|
+
"effective_to": "example_effective_to",
|
|
2255
|
+
"surcharge": "example_surcharge"
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
generic_model_validation_test(SurchargeUpdateReq, example_input)
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
def test_surchargeupdatereq_validation_with_invalid_data():
|
|
2262
|
+
"""Test validation failure for SurchargeUpdateReq model with invalid data."""
|
|
2263
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2264
|
+
|
|
2265
|
+
with pytest.raises(ValidationError):
|
|
2266
|
+
SurchargeUpdateReq.model_validate(invalid_input)
|
|
2267
|
+
|
|
2268
|
+
def test_tanklidenum_validation():
|
|
2269
|
+
"""Test validation for TankLidEnum model."""
|
|
2270
|
+
example_input = {
|
|
2271
|
+
"root": "example_root"
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
generic_model_validation_test(TankLidEnum, example_input)
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
def test_tanklidenum_validation_with_invalid_data():
|
|
2278
|
+
"""Test validation failure for TankLidEnum model with invalid data."""
|
|
2279
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2280
|
+
|
|
2281
|
+
with pytest.raises(ValidationError):
|
|
2282
|
+
TankLidEnum.model_validate(invalid_input)
|
|
2283
|
+
|
|
2284
|
+
def test_terminaltype_validation():
|
|
2285
|
+
"""Test validation for TerminalType model."""
|
|
2286
|
+
example_input = {
|
|
2287
|
+
"root": "example_root"
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
generic_model_validation_test(TerminalType, example_input)
|
|
2291
|
+
|
|
2292
|
+
|
|
2293
|
+
def test_terminaltype_validation_with_invalid_data():
|
|
2294
|
+
"""Test validation failure for TerminalType model with invalid data."""
|
|
2295
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2296
|
+
|
|
2297
|
+
with pytest.raises(ValidationError):
|
|
2298
|
+
TerminalType.model_validate(invalid_input)
|
|
2299
|
+
|
|
2300
|
+
def test_timezoneenum_validation():
|
|
2301
|
+
"""Test validation for TimezoneEnum model."""
|
|
2302
|
+
example_input = {
|
|
2303
|
+
"root": "example_root"
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
generic_model_validation_test(TimezoneEnum, example_input)
|
|
2307
|
+
|
|
2308
|
+
|
|
2309
|
+
def test_timezoneenum_validation_with_invalid_data():
|
|
2310
|
+
"""Test validation failure for TimezoneEnum model with invalid data."""
|
|
2311
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2312
|
+
|
|
2313
|
+
with pytest.raises(ValidationError):
|
|
2314
|
+
TimezoneEnum.model_validate(invalid_input)
|
|
2315
|
+
|
|
2316
|
+
def test_tractorview_validation():
|
|
2317
|
+
"""Test validation for TractorView model."""
|
|
2318
|
+
example_input = {
|
|
2319
|
+
"id": "example_id",
|
|
2320
|
+
"tractor_number": "example_tractor_number",
|
|
2321
|
+
"depot": "example_depot",
|
|
2322
|
+
"vin": "example_vin",
|
|
2323
|
+
"model": "example_model",
|
|
2324
|
+
"make": "example_make",
|
|
2325
|
+
"year": "example_year",
|
|
2326
|
+
"weight": "example_weight",
|
|
2327
|
+
"next_maintenance": "example_next_maintenance",
|
|
2328
|
+
"next_tractor_maintenance_required": "example_next_tractor_maintenance_required",
|
|
2329
|
+
"updated_on": "example_updated_on",
|
|
2330
|
+
"extra_data": "example_extra_data"
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
generic_model_validation_test(TractorView, example_input)
|
|
2334
|
+
|
|
2335
|
+
|
|
2336
|
+
def test_tractorview_validation_with_invalid_data():
|
|
2337
|
+
"""Test validation failure for TractorView model with invalid data."""
|
|
2338
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2339
|
+
|
|
2340
|
+
with pytest.raises(ValidationError):
|
|
2341
|
+
TractorView.model_validate(invalid_input)
|
|
2342
|
+
|
|
2343
|
+
def test_trailerconfigmatrixview_validation():
|
|
2344
|
+
"""Test validation for TrailerConfigMatrixView model."""
|
|
2345
|
+
example_input = {
|
|
2346
|
+
"id": "example_id",
|
|
2347
|
+
"importance": 42,
|
|
2348
|
+
"trailer_config": "example_trailer_config",
|
|
2349
|
+
"code": "example_code",
|
|
2350
|
+
"values": "example_values",
|
|
2351
|
+
"updated_on": "example_updated_on"
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
generic_model_validation_test(TrailerConfigMatrixView, example_input)
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
def test_trailerconfigmatrixview_validation_with_invalid_data():
|
|
2358
|
+
"""Test validation failure for TrailerConfigMatrixView model with invalid data."""
|
|
2359
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2360
|
+
|
|
2361
|
+
with pytest.raises(ValidationError):
|
|
2362
|
+
TrailerConfigMatrixView.model_validate(invalid_input)
|
|
2363
|
+
|
|
2364
|
+
def test_trailerview_validation():
|
|
2365
|
+
"""Test validation for TrailerView model."""
|
|
2366
|
+
example_input = {
|
|
2367
|
+
"id": "example_id",
|
|
2368
|
+
"trailer_number": "example_trailer_number",
|
|
2369
|
+
"configuration": "example_configuration",
|
|
2370
|
+
"depot": "example_depot",
|
|
2371
|
+
"make": "example_make",
|
|
2372
|
+
"model": "example_model",
|
|
2373
|
+
"weight": "example_weight",
|
|
2374
|
+
"updated_on": "example_updated_on",
|
|
2375
|
+
"extra_data": "example_extra_data"
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
generic_model_validation_test(TrailerView, example_input)
|
|
2379
|
+
|
|
2380
|
+
|
|
2381
|
+
def test_trailerview_validation_with_invalid_data():
|
|
2382
|
+
"""Test validation failure for TrailerView model with invalid data."""
|
|
2383
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2384
|
+
|
|
2385
|
+
with pytest.raises(ValidationError):
|
|
2386
|
+
TrailerView.model_validate(invalid_input)
|
|
2387
|
+
|
|
2388
|
+
def test_unavailablehours_validation():
|
|
2389
|
+
"""Test validation for UnavailableHours model."""
|
|
2390
|
+
example_input = {
|
|
2391
|
+
"root": "example_root"
|
|
2392
|
+
}
|
|
2393
|
+
|
|
2394
|
+
generic_model_validation_test(UnavailableHours, example_input)
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
def test_unavailablehours_validation_with_invalid_data():
|
|
2398
|
+
"""Test validation failure for UnavailableHours model with invalid data."""
|
|
2399
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2400
|
+
|
|
2401
|
+
with pytest.raises(ValidationError):
|
|
2402
|
+
UnavailableHours.model_validate(invalid_input)
|
|
2403
|
+
|
|
2404
|
+
def test_unavailablehoursrequest_validation():
|
|
2405
|
+
"""Test validation for UnavailableHoursRequest model."""
|
|
2406
|
+
example_input = {
|
|
2407
|
+
"root": "example_root"
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
generic_model_validation_test(UnavailableHoursRequest, example_input)
|
|
2411
|
+
|
|
2412
|
+
|
|
2413
|
+
def test_unavailablehoursrequest_validation_with_invalid_data():
|
|
2414
|
+
"""Test validation failure for UnavailableHoursRequest model with invalid data."""
|
|
2415
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2416
|
+
|
|
2417
|
+
with pytest.raises(ValidationError):
|
|
2418
|
+
UnavailableHoursRequest.model_validate(invalid_input)
|
|
2419
|
+
|
|
2420
|
+
def test_updateresponse_validation():
|
|
2421
|
+
"""Test validation for UpdateResponse model."""
|
|
2422
|
+
example_input = {
|
|
2423
|
+
"created": "example_created",
|
|
2424
|
+
"end_dated": "example_end_dated",
|
|
2425
|
+
"bad_data": "example_bad_data",
|
|
2426
|
+
"duplicates": "example_duplicates",
|
|
2427
|
+
"exact_match": "example_exact_match"
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
generic_model_validation_test(UpdateResponse, example_input)
|
|
2431
|
+
|
|
2432
|
+
|
|
2433
|
+
def test_updateresponse_validation_with_invalid_data():
|
|
2434
|
+
"""Test validation failure for UpdateResponse model with invalid data."""
|
|
2435
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2436
|
+
|
|
2437
|
+
with pytest.raises(ValidationError):
|
|
2438
|
+
UpdateResponse.model_validate(invalid_input)
|
|
2439
|
+
|
|
2440
|
+
def test_uploadimsrequest_validation():
|
|
2441
|
+
"""Test validation for UploadIMSRequest model."""
|
|
2442
|
+
example_input = {
|
|
2443
|
+
"store": "example_store",
|
|
2444
|
+
"tank": "example_tank",
|
|
2445
|
+
"timezone": "example_timezone",
|
|
2446
|
+
"date": "example_date",
|
|
2447
|
+
"inches": "example_inches",
|
|
2448
|
+
"volume": "example_volume",
|
|
2449
|
+
"payload": "example_payload"
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
generic_model_validation_test(UploadIMSRequest, example_input)
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
def test_uploadimsrequest_validation_with_invalid_data():
|
|
2456
|
+
"""Test validation failure for UploadIMSRequest model with invalid data."""
|
|
2457
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2458
|
+
|
|
2459
|
+
with pytest.raises(ValidationError):
|
|
2460
|
+
UploadIMSRequest.model_validate(invalid_input)
|
|
2461
|
+
|
|
2462
|
+
def test_upsertlocationrequest_validation():
|
|
2463
|
+
"""Test validation for UpsertLocationRequest model."""
|
|
2464
|
+
example_input = {
|
|
2465
|
+
"id": "example_id",
|
|
2466
|
+
"source_id": "example_source_id",
|
|
2467
|
+
"source_system_id": "example_source_system_id",
|
|
2468
|
+
"name": "example_name",
|
|
2469
|
+
"short_name": "example_short_name",
|
|
2470
|
+
"address": "example_address",
|
|
2471
|
+
"type": "example_type",
|
|
2472
|
+
"city": "example_city",
|
|
2473
|
+
"state": "example_state",
|
|
2474
|
+
"postal_code": "example_postal_code",
|
|
2475
|
+
"market_id": "example_market_id",
|
|
2476
|
+
"market": "example_market",
|
|
2477
|
+
"lat": 3.14,
|
|
2478
|
+
"lon": 3.14,
|
|
2479
|
+
"hours": "example_hours",
|
|
2480
|
+
"contact": "example_contact",
|
|
2481
|
+
"contact_phone": "example_contact_phone",
|
|
2482
|
+
"active": "example_active",
|
|
2483
|
+
"include_in_backhaul": "example_include_in_backhaul",
|
|
2484
|
+
"start_time": "example_start_time",
|
|
2485
|
+
"end_time": "example_end_time",
|
|
2486
|
+
"requires_card": "example_requires_card",
|
|
2487
|
+
"splash_blending": "example_splash_blending",
|
|
2488
|
+
"split_load_terminals": "example_split_load_terminals",
|
|
2489
|
+
"authorized_carriers": "example_authorized_carriers",
|
|
2490
|
+
"extra_data": "example_extra_data",
|
|
2491
|
+
"geofence": "example_geofence",
|
|
2492
|
+
"supply_zones": "example_supply_zones",
|
|
2493
|
+
"supply_map": "example_supply_map"
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
generic_model_validation_test(UpsertLocationRequest, example_input)
|
|
2497
|
+
|
|
2498
|
+
|
|
2499
|
+
def test_upsertlocationrequest_validation_with_invalid_data():
|
|
2500
|
+
"""Test validation failure for UpsertLocationRequest model with invalid data."""
|
|
2501
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2502
|
+
|
|
2503
|
+
with pytest.raises(ValidationError):
|
|
2504
|
+
UpsertLocationRequest.model_validate(invalid_input)
|
|
2505
|
+
|
|
2506
|
+
def test_upsertmanycounterpartyrequest_validation():
|
|
2507
|
+
"""Test validation for UpsertManyCounterpartyRequest model."""
|
|
2508
|
+
example_input = {
|
|
2509
|
+
"id": "example_id",
|
|
2510
|
+
"source_id": "example_source_id",
|
|
2511
|
+
"source_system_id": "example_source_system_id",
|
|
2512
|
+
"name": "example_name",
|
|
2513
|
+
"types": "example_types",
|
|
2514
|
+
"carrier_type": "example_carrier_type",
|
|
2515
|
+
"trailer_config": "example_trailer_config",
|
|
2516
|
+
"emails": "example_emails",
|
|
2517
|
+
"sourcing_strategy": "example_sourcing_strategy",
|
|
2518
|
+
"extra_data": "example_extra_data",
|
|
2519
|
+
"goid": "example_goid",
|
|
2520
|
+
"allow_short_loads": "example_allow_short_loads",
|
|
2521
|
+
"order_notification_preferences": "example_order_notification_preferences",
|
|
2522
|
+
"supply_map": "example_supply_map",
|
|
2523
|
+
"available_credit": "example_available_credit",
|
|
2524
|
+
"hold": "example_hold"
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
generic_model_validation_test(UpsertManyCounterpartyRequest, example_input)
|
|
2528
|
+
|
|
2529
|
+
|
|
2530
|
+
def test_upsertmanycounterpartyrequest_validation_with_invalid_data():
|
|
2531
|
+
"""Test validation failure for UpsertManyCounterpartyRequest model with invalid data."""
|
|
2532
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2533
|
+
|
|
2534
|
+
with pytest.raises(ValidationError):
|
|
2535
|
+
UpsertManyCounterpartyRequest.model_validate(invalid_input)
|
|
2536
|
+
|
|
2537
|
+
def test_upsertmanydriverrequest_validation():
|
|
2538
|
+
"""Test validation for UpsertManyDriverRequest model."""
|
|
2539
|
+
example_input = {
|
|
2540
|
+
"id": "example_id",
|
|
2541
|
+
"source_id": "example_source_id",
|
|
2542
|
+
"source_system_id": "example_source_system_id",
|
|
2543
|
+
"name": "example_name",
|
|
2544
|
+
"username": "example_username",
|
|
2545
|
+
"email": "example_email",
|
|
2546
|
+
"title": "example_title",
|
|
2547
|
+
"hire_date": "example_hire_date",
|
|
2548
|
+
"termination_date": "example_termination_date",
|
|
2549
|
+
"depot": "example_depot",
|
|
2550
|
+
"depot_id": "example_depot_id",
|
|
2551
|
+
"in_cab_trip_mode": "example_in_cab_trip_mode",
|
|
2552
|
+
"in_cab_supply_option_mode": "example_in_cab_supply_option_mode",
|
|
2553
|
+
"preferred_template": "example_preferred_template",
|
|
2554
|
+
"shift_preference": "example_shift_preference",
|
|
2555
|
+
"shift_length_hours": "example_shift_length_hours",
|
|
2556
|
+
"tractor_number": "example_tractor_number",
|
|
2557
|
+
"tractor_id": "example_tractor_id",
|
|
2558
|
+
"trailer_number": "example_trailer_number",
|
|
2559
|
+
"trailer_id": "example_trailer_id",
|
|
2560
|
+
"carded_terminals": "example_carded_terminals",
|
|
2561
|
+
"supervisor": "example_supervisor",
|
|
2562
|
+
"active": "example_active"
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
generic_model_validation_test(UpsertManyDriverRequest, example_input)
|
|
2566
|
+
|
|
2567
|
+
|
|
2568
|
+
def test_upsertmanydriverrequest_validation_with_invalid_data():
|
|
2569
|
+
"""Test validation failure for UpsertManyDriverRequest model with invalid data."""
|
|
2570
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2571
|
+
|
|
2572
|
+
with pytest.raises(ValidationError):
|
|
2573
|
+
UpsertManyDriverRequest.model_validate(invalid_input)
|
|
2574
|
+
|
|
2575
|
+
def test_upsertmanystorerequest_validation():
|
|
2576
|
+
"""Test validation for UpsertManyStoreRequest model."""
|
|
2577
|
+
example_input = {
|
|
2578
|
+
"id": "example_id",
|
|
2579
|
+
"store_number": "example_store_number",
|
|
2580
|
+
"name": "example_name",
|
|
2581
|
+
"address": "example_address",
|
|
2582
|
+
"city": "example_city",
|
|
2583
|
+
"state": "example_state",
|
|
2584
|
+
"postal_code": "example_postal_code",
|
|
2585
|
+
"phone_number": "example_phone_number",
|
|
2586
|
+
"emails": "example_emails",
|
|
2587
|
+
"hours": "example_hours",
|
|
2588
|
+
"market": "example_market",
|
|
2589
|
+
"market_id": "example_market_id",
|
|
2590
|
+
"sector": "example_sector",
|
|
2591
|
+
"sector_id": "example_sector_id",
|
|
2592
|
+
"trailer_config": "example_trailer_config",
|
|
2593
|
+
"lat": 3.14,
|
|
2594
|
+
"lon": 3.14,
|
|
2595
|
+
"timezone": "example_timezone",
|
|
2596
|
+
"status": "example_status",
|
|
2597
|
+
"contact_name": "example_contact_name",
|
|
2598
|
+
"open_date": "example_open_date",
|
|
2599
|
+
"close_date": "example_close_date",
|
|
2600
|
+
"unavailable_hours": "example_unavailable_hours",
|
|
2601
|
+
"counterparty_id": "example_counterparty_id",
|
|
2602
|
+
"counterparty_name": "example_counterparty_name",
|
|
2603
|
+
"supply_owner_id": "example_supply_owner_id",
|
|
2604
|
+
"supply_owner_name": "example_supply_owner_name",
|
|
2605
|
+
"freight_customer_id": "example_freight_customer_id",
|
|
2606
|
+
"freight_customer_name": "example_freight_customer_name",
|
|
2607
|
+
"freight_region_name": "example_freight_region_name",
|
|
2608
|
+
"freight_region_id": "example_freight_region_id",
|
|
2609
|
+
"extra_data": "example_extra_data",
|
|
2610
|
+
"monitoring_strategy": "example_monitoring_strategy",
|
|
2611
|
+
"estick_monitor_override": "example_estick_monitor_override",
|
|
2612
|
+
"drop_workflow": "example_drop_workflow",
|
|
2613
|
+
"credit_hold": "example_credit_hold",
|
|
2614
|
+
"compliance_hold_date": "example_compliance_hold_date",
|
|
2615
|
+
"allow_by_product_request": "example_allow_by_product_request",
|
|
2616
|
+
"in_network_terminals": "example_in_network_terminals",
|
|
2617
|
+
"delivery_window_default_name": "example_delivery_window_default_name",
|
|
2618
|
+
"delivery_window_default_id": "example_delivery_window_default_id",
|
|
2619
|
+
"geofence": "example_geofence"
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
generic_model_validation_test(UpsertManyStoreRequest, example_input)
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
def test_upsertmanystorerequest_validation_with_invalid_data():
|
|
2626
|
+
"""Test validation failure for UpsertManyStoreRequest model with invalid data."""
|
|
2627
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2628
|
+
|
|
2629
|
+
with pytest.raises(ValidationError):
|
|
2630
|
+
UpsertManyStoreRequest.model_validate(invalid_input)
|
|
2631
|
+
|
|
2632
|
+
def test_upsertproductrequest_validation():
|
|
2633
|
+
"""Test validation for UpsertProductRequest model."""
|
|
2634
|
+
example_input = {
|
|
2635
|
+
"group": "example_group",
|
|
2636
|
+
"weight_group": "example_weight_group",
|
|
2637
|
+
"extra_data": "example_extra_data",
|
|
2638
|
+
"id": "example_id",
|
|
2639
|
+
"source_id": "example_source_id",
|
|
2640
|
+
"source_system_id": "example_source_system_id",
|
|
2641
|
+
"name": "example_name",
|
|
2642
|
+
"alias": "example_alias",
|
|
2643
|
+
"enabled": "example_enabled",
|
|
2644
|
+
"specific_gravity": "example_specific_gravity",
|
|
2645
|
+
"short_name": "example_short_name",
|
|
2646
|
+
"icon": "example_icon",
|
|
2647
|
+
"tank_lid_code_id": "example_tank_lid_code_id",
|
|
2648
|
+
"supply_map": "example_supply_map"
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
generic_model_validation_test(UpsertProductRequest, example_input)
|
|
2652
|
+
|
|
2653
|
+
|
|
2654
|
+
def test_upsertproductrequest_validation_with_invalid_data():
|
|
2655
|
+
"""Test validation failure for UpsertProductRequest model with invalid data."""
|
|
2656
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2657
|
+
|
|
2658
|
+
with pytest.raises(ValidationError):
|
|
2659
|
+
UpsertProductRequest.model_validate(invalid_input)
|
|
2660
|
+
|
|
2661
|
+
def test_upserttankrequest_validation():
|
|
2662
|
+
"""Test validation for UpsertTankRequest model."""
|
|
2663
|
+
example_input = {
|
|
2664
|
+
"id": "example_id",
|
|
2665
|
+
"source_id": "example_source_id",
|
|
2666
|
+
"source_system_id": "example_source_system_id",
|
|
2667
|
+
"store_id": "example_store_id",
|
|
2668
|
+
"tank_id": "example_tank_id",
|
|
2669
|
+
"island": "example_island",
|
|
2670
|
+
"icon": "example_icon",
|
|
2671
|
+
"product_id": "example_product_id",
|
|
2672
|
+
"product": "example_product",
|
|
2673
|
+
"description": "example_description",
|
|
2674
|
+
"tank_chart": "example_tank_chart",
|
|
2675
|
+
"storage_max": "example_storage_max",
|
|
2676
|
+
"tank_size": "example_tank_size",
|
|
2677
|
+
"fuel_bottom": "example_fuel_bottom",
|
|
2678
|
+
"manufacturer": "example_manufacturer",
|
|
2679
|
+
"dimensions": "example_dimensions",
|
|
2680
|
+
"tank_color": "example_tank_color",
|
|
2681
|
+
"minimum_load_size": "example_minimum_load_size",
|
|
2682
|
+
"maximum_load_size": "example_maximum_load_size",
|
|
2683
|
+
"strapping_table": "example_strapping_table",
|
|
2684
|
+
"target_min": "example_target_min",
|
|
2685
|
+
"target_max": "example_target_max",
|
|
2686
|
+
"inventory_strategy": "example_inventory_strategy",
|
|
2687
|
+
"load_tags": "example_load_tags",
|
|
2688
|
+
"filter_tags": "example_filter_tags",
|
|
2689
|
+
"split_me": "example_split_me",
|
|
2690
|
+
"water_reading_requirement": "example_water_reading_requirement",
|
|
2691
|
+
"requires_pump": "example_requires_pump",
|
|
2692
|
+
"carrier_id": "example_carrier_id",
|
|
2693
|
+
"carrier": "example_carrier",
|
|
2694
|
+
"extra_data": "example_extra_data",
|
|
2695
|
+
"active": "example_active",
|
|
2696
|
+
"manifold_id": "example_manifold_id",
|
|
2697
|
+
"apportion_percentage": "example_apportion_percentage",
|
|
2698
|
+
"compliance_hold": "example_compliance_hold",
|
|
2699
|
+
"demand_model_tank_profile": "example_demand_model_tank_profile",
|
|
2700
|
+
"store_number": "example_store_number"
|
|
2701
|
+
}
|
|
2702
|
+
|
|
2703
|
+
generic_model_validation_test(UpsertTankRequest, example_input)
|
|
2704
|
+
|
|
2705
|
+
|
|
2706
|
+
def test_upserttankrequest_validation_with_invalid_data():
|
|
2707
|
+
"""Test validation failure for UpsertTankRequest model with invalid data."""
|
|
2708
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2709
|
+
|
|
2710
|
+
with pytest.raises(ValidationError):
|
|
2711
|
+
UpsertTankRequest.model_validate(invalid_input)
|
|
2712
|
+
|
|
2713
|
+
def test_upserttractorreq_validation():
|
|
2714
|
+
"""Test validation for UpsertTractorReq model."""
|
|
2715
|
+
example_input = {
|
|
2716
|
+
"id": "example_id",
|
|
2717
|
+
"tractor_number": "example_tractor_number",
|
|
2718
|
+
"depot": "example_depot",
|
|
2719
|
+
"vin": "example_vin",
|
|
2720
|
+
"make": "example_make",
|
|
2721
|
+
"model": "example_model",
|
|
2722
|
+
"year": "example_year",
|
|
2723
|
+
"weight": "example_weight",
|
|
2724
|
+
"next_maintenance": "example_next_maintenance",
|
|
2725
|
+
"next_tractor_maintenance_required": "example_next_tractor_maintenance_required",
|
|
2726
|
+
"source_id": "example_source_id",
|
|
2727
|
+
"source_system_id": "example_source_system_id"
|
|
2728
|
+
}
|
|
2729
|
+
|
|
2730
|
+
generic_model_validation_test(UpsertTractorReq, example_input)
|
|
2731
|
+
|
|
2732
|
+
|
|
2733
|
+
def test_upserttractorreq_validation_with_invalid_data():
|
|
2734
|
+
"""Test validation failure for UpsertTractorReq model with invalid data."""
|
|
2735
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2736
|
+
|
|
2737
|
+
with pytest.raises(ValidationError):
|
|
2738
|
+
UpsertTractorReq.model_validate(invalid_input)
|
|
2739
|
+
|
|
2740
|
+
def test_upserttractorresp_validation():
|
|
2741
|
+
"""Test validation for UpsertTractorResp model."""
|
|
2742
|
+
example_input = {
|
|
2743
|
+
"created": "example_created",
|
|
2744
|
+
"updated": "example_updated",
|
|
2745
|
+
"errors": "example_errors"
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
generic_model_validation_test(UpsertTractorResp, example_input)
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
def test_upserttractorresp_validation_with_invalid_data():
|
|
2752
|
+
"""Test validation failure for UpsertTractorResp model with invalid data."""
|
|
2753
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2754
|
+
|
|
2755
|
+
with pytest.raises(ValidationError):
|
|
2756
|
+
UpsertTractorResp.model_validate(invalid_input)
|
|
2757
|
+
|
|
2758
|
+
def test_upserttrailerreq_validation():
|
|
2759
|
+
"""Test validation for UpsertTrailerReq model."""
|
|
2760
|
+
example_input = {
|
|
2761
|
+
"id": "example_id",
|
|
2762
|
+
"trailer_number": "example_trailer_number",
|
|
2763
|
+
"configuration": "example_configuration",
|
|
2764
|
+
"depot": "example_depot",
|
|
2765
|
+
"make": "example_make",
|
|
2766
|
+
"model": "example_model",
|
|
2767
|
+
"weight": "example_weight",
|
|
2768
|
+
"source_id": "example_source_id",
|
|
2769
|
+
"source_system_id": "example_source_system_id"
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
generic_model_validation_test(UpsertTrailerReq, example_input)
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
def test_upserttrailerreq_validation_with_invalid_data():
|
|
2776
|
+
"""Test validation failure for UpsertTrailerReq model with invalid data."""
|
|
2777
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2778
|
+
|
|
2779
|
+
with pytest.raises(ValidationError):
|
|
2780
|
+
UpsertTrailerReq.model_validate(invalid_input)
|
|
2781
|
+
|
|
2782
|
+
def test_upserttrailerresp_validation():
|
|
2783
|
+
"""Test validation for UpsertTrailerResp model."""
|
|
2784
|
+
example_input = {
|
|
2785
|
+
"created": "example_created",
|
|
2786
|
+
"updated": "example_updated",
|
|
2787
|
+
"errors": "example_errors"
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
generic_model_validation_test(UpsertTrailerResp, example_input)
|
|
2791
|
+
|
|
2792
|
+
|
|
2793
|
+
def test_upserttrailerresp_validation_with_invalid_data():
|
|
2794
|
+
"""Test validation failure for UpsertTrailerResp model with invalid data."""
|
|
2795
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2796
|
+
|
|
2797
|
+
with pytest.raises(ValidationError):
|
|
2798
|
+
UpsertTrailerResp.model_validate(invalid_input)
|
|
2799
|
+
|
|
2800
|
+
def test_validationerror_validation():
|
|
2801
|
+
"""Test validation for ValidationError model."""
|
|
2802
|
+
example_input = {
|
|
2803
|
+
"root": "example_root"
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
generic_model_validation_test(ValidationError, example_input)
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
def test_validationerror_validation_with_invalid_data():
|
|
2810
|
+
"""Test validation failure for ValidationError model with invalid data."""
|
|
2811
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2812
|
+
|
|
2813
|
+
with pytest.raises(ValidationError):
|
|
2814
|
+
ValidationError.model_validate(invalid_input)
|
|
2815
|
+
|
|
2816
|
+
def test_volumedistributionrequest_validation():
|
|
2817
|
+
"""Test validation for VolumeDistributionRequest model."""
|
|
2818
|
+
example_input = {
|
|
2819
|
+
"root": "example_root"
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
generic_model_validation_test(VolumeDistributionRequest, example_input)
|
|
2823
|
+
|
|
2824
|
+
|
|
2825
|
+
def test_volumedistributionrequest_validation_with_invalid_data():
|
|
2826
|
+
"""Test validation failure for VolumeDistributionRequest model with invalid data."""
|
|
2827
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2828
|
+
|
|
2829
|
+
with pytest.raises(ValidationError):
|
|
2830
|
+
VolumeDistributionRequest.model_validate(invalid_input)
|
|
2831
|
+
|
|
2832
|
+
def test_waterreadingrequirement_validation():
|
|
2833
|
+
"""Test validation for WaterReadingRequirement model."""
|
|
2834
|
+
example_input = {
|
|
2835
|
+
"root": "example_root"
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
generic_model_validation_test(WaterReadingRequirement, example_input)
|
|
2839
|
+
|
|
2840
|
+
|
|
2841
|
+
def test_waterreadingrequirement_validation_with_invalid_data():
|
|
2842
|
+
"""Test validation failure for WaterReadingRequirement model with invalid data."""
|
|
2843
|
+
invalid_input = {"invalid_field": "should_fail"}
|
|
2844
|
+
|
|
2845
|
+
with pytest.raises(ValidationError):
|
|
2846
|
+
WaterReadingRequirement.model_validate(invalid_input)
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
# Parametrized test for all models
|
|
2850
|
+
@pytest.mark.parametrize("model_class,example_input", [
|
|
2851
|
+
(AllocatedBolResponse, {"root": "example_root"}),
|
|
2852
|
+
(BillableDateType, {"root": "example_root"}),
|
|
2853
|
+
(BillableVolumeType, {"root": "example_root"}),
|
|
2854
|
+
(BlendView, {"root": "example_root"}),
|
|
2855
|
+
(BolAndDropResponse, {"order_number": "example_order_number", "order_id": "example_order_id", "po": "example_po", "carrier_id": "example_carrier_id", "last_movement_update": "example_last_movement_update", "order_date": "example_order_date", "status": "example_status", "type": "example_type", "drops": "example_drops", "bols": "example_bols", "costs": "example_costs", "validation_bypass_on": "example_validation_bypass_on", "has_additives": "example_has_additives", "estimated_freight": "example_estimated_freight", "actual_freight": "example_actual_freight", "allocated_bol_error": "example_allocated_bol_error", "allocated_bol_issue": "example_allocated_bol_issue", "allocated_bols": "example_allocated_bols", "last_change_date": "example_last_change_date", "reference_order_number": "example_reference_order_number"}),
|
|
2856
|
+
(BolImageResponse, {"root": "example_root"}),
|
|
2857
|
+
(BolImagesRequest, {"order_ids": "example_order_ids", "order_numbers": "example_order_numbers"}),
|
|
2858
|
+
(BolImagesResponse, {"order_id": "example_order_id", "bol_id": "example_bol_id", "bol_number": "example_bol_number", "photos": "example_photos"}),
|
|
2859
|
+
(BolsAndDropsRequest, {"order_date_start": "example_order_date_start", "order_date_end": "example_order_date_end", "movement_updated_start": "example_movement_updated_start", "movement_updated_end": "example_movement_updated_end", "order_ids": "example_order_ids", "order_numbers": "example_order_numbers", "order_states": "example_order_states", "order_types": "example_order_types", "include_invalid": "example_include_invalid", "include_bol_allocation": "example_include_bol_allocation", "last_change_date": "example_last_change_date", "reference_order_numbers": "example_reference_order_numbers"}),
|
|
2860
|
+
(Card, {"root": "example_root"}),
|
|
2861
|
+
(ContractVolumeRequest, {"root": "example_root"}),
|
|
2862
|
+
(Coordinate, {"root": "example_root"}),
|
|
2863
|
+
(Counterparty, {"root": "example_root"}),
|
|
2864
|
+
(CounterpartyView, {"id": "example_id", "name": "example_name", "goid": "example_goid", "scac": "example_scac", "types": "example_types", "carrier_type": "example_carrier_type", "trailer_config": "example_trailer_config", "source_id": "example_source_id", "source_system": "example_source_system", "source_system_id": "example_source_system_id", "emails": "example_emails", "sourcing_strategy": "example_sourcing_strategy", "extra_data": "example_extra_data", "updated_on": "example_updated_on", "allow_short_loads": "example_allow_short_loads", "order_notification_preferences": "example_order_notification_preferences", "supply_map": "example_supply_map"}),
|
|
2865
|
+
(CreateGroupRequest, {"source_id": "example_source_id", "name": "example_name", "keys": "example_keys", "as_of": "example_as_of", "min": "example_min", "max": "example_max", "start_hour": "example_start_hour", "volume_distributions": "example_volume_distributions", "contract_volumes": "example_contract_volumes", "daily_percent": "example_daily_percent", "weekly_percent": "example_weekly_percent", "monthly_percent": "example_monthly_percent", "contract_start": "example_contract_start", "contract_end": "example_contract_end", "week_start_day": "example_week_start_day"}),
|
|
2866
|
+
(DateWindow, {"root": "example_root"}),
|
|
2867
|
+
(DaysOfWeek, {"root": "example_root"}),
|
|
2868
|
+
(DeliveryRequestStatus, {"root": "example_root"}),
|
|
2869
|
+
(DeliveryTicketById, {"order_id": "example_order_id", "store_id": "example_store_id"}),
|
|
2870
|
+
(DeliveryTicketByNumber, {"order_number": 42, "store_number": "example_store_number"}),
|
|
2871
|
+
(DeliveryWindow, {"root": "example_root"}),
|
|
2872
|
+
(DeliveryWindowDefault, {"root": "example_root"}),
|
|
2873
|
+
(DriverCredentialUpsertRequest, {"driver_id": "example_driver_id", "credential_id": "example_credential_id", "certification_date": "example_certification_date", "expiration_date": "example_expiration_date"}),
|
|
2874
|
+
(DriverCredentialView, {"root": "example_root"}),
|
|
2875
|
+
(DriverTerminalCardView, {"root": "example_root"}),
|
|
2876
|
+
(DriverView, {"id": "example_id", "name": "example_name", "username": "example_username", "depot_id": "example_depot_id", "depot_name": "example_depot_name", "in_cab_trip_mode": "example_in_cab_trip_mode", "in_cab_supply_option_mode": "example_in_cab_supply_option_mode", "trailer_number": "example_trailer_number", "tractor_number": "example_tractor_number", "updated_on": "example_updated_on", "extra_data": "example_extra_data", "cards": "example_cards", "credentials": "example_credentials"}),
|
|
2877
|
+
(DropCreateRequest, {"root": "example_root"}),
|
|
2878
|
+
(DropWorkflow, {"root": "example_root"}),
|
|
2879
|
+
(Dwell, {"root": "example_root"}),
|
|
2880
|
+
(EBolDetailRequest, {"root": "example_root"}),
|
|
2881
|
+
(EBolRequest, {"source_system": "example_source_system", "bol_number": "example_bol_number", "date": "example_date", "terminal_id": "example_terminal_id", "supplier_id": "example_supplier_id", "details": "example_details"}),
|
|
2882
|
+
(ExternalBOLDetailRequest, {"root": "example_root"}),
|
|
2883
|
+
(ExternalBOLRequest, {"order_id": "example_order_id", "bol_number": "example_bol_number", "terminal_id": "example_terminal_id", "bol_date": "example_bol_date", "details": "example_details"}),
|
|
2884
|
+
(ForecastApiCreateRequest, {"root": "example_root"}),
|
|
2885
|
+
(FormFieldResponse, {"root": "example_root"}),
|
|
2886
|
+
(FormResponseRow, {"id": "example_id", "name": "example_name", "description": "example_description", "order_number": 42, "driver_name": "example_driver_name", "date": "example_date", "shift": "example_shift", "location_name": "example_location_name", "address": "example_address", "latitude": "example_latitude", "longitude": "example_longitude", "market": "example_market", "sector": "example_sector", "supply_zones": "example_supply_zones", "tractor": "example_tractor", "trailer_number": "example_trailer_number", "required": "example_required", "response": "example_response"}),
|
|
2887
|
+
(FreightCost, {"root": "example_root"}),
|
|
2888
|
+
(FreightIntegrationReq, {"order_numbers": "example_order_numbers", "order_ids": "example_order_ids", "last_change_date": "example_last_change_date"}),
|
|
2889
|
+
(FreightItem, {"root": "example_root"}),
|
|
2890
|
+
(FreightTransactionDetailOutput, {"root": "example_root"}),
|
|
2891
|
+
(FreightTransactionOutput, {"root": "example_root"}),
|
|
2892
|
+
(FreightTransactionRowOutput, {"root": "example_root"}),
|
|
2893
|
+
(GetOrderRequestResponse, {"type": "example_type", "number": 42, "order_id": "example_order_id", "order_number": "example_order_number", "order_date": "example_order_date", "order_state": "example_order_state", "reference_order_number": "example_reference_order_number", "last_change_date": "example_last_change_date", "site_name": "example_site_name", "site_id": "example_site_id", "customer_id": "example_customer_id", "customer_name": "example_customer_name", "delivery_window_start": "example_delivery_window_start", "delivery_window_end": "example_delivery_window_end", "products": "example_products", "extra_data": "example_extra_data", "status": "example_status"}),
|
|
2894
|
+
(GetOrderResponse, {"type": "example_type", "order_id": "example_order_id", "drivers": "example_drivers", "order_number": "example_order_number", "order_date": "example_order_date", "order_state": "example_order_state", "carrier_window_start": "example_carrier_window_start", "carrier_window_end": "example_carrier_window_end", "carrier_notify_state": "example_carrier_notify_state", "load_window_start": "example_load_window_start", "load_window_end": "example_load_window_end", "dispatch_window_start": "example_dispatch_window_start", "dispatch_window_end": "example_dispatch_window_end", "hauler_counterparty_id": "example_hauler_counterparty_id", "hauler_counterparty_name": "example_hauler_counterparty_name", "hauler_counterparty_source_id": "example_hauler_counterparty_source_id", "hauler_counterparty_source_system": "example_hauler_counterparty_source_system", "hauled_by_updated_by": "example_hauled_by_updated_by", "hauled_by_updated": "example_hauled_by_updated", "loads": "example_loads", "drops": "example_drops", "trip_status": "example_trip_status", "last_change_date": "example_last_change_date", "market": "example_market", "supply_option": "example_supply_option", "created_by": "example_created_by", "note": "example_note", "estimated_load_minutes": "example_estimated_load_minutes", "total_miles": "example_total_miles", "loaded_miles": "example_loaded_miles", "unloaded_miles": "example_unloaded_miles", "reference_order_number": "example_reference_order_number", "extra_data": "example_extra_data"}),
|
|
2895
|
+
(GetOrdersRequest, {"order_id": "example_order_id", "order_number": "example_order_number", "type": "example_type", "state": "example_state", "last_change_date": "example_last_change_date", "order_date_start": "example_order_date_start", "order_date_end": "example_order_date_end", "reference_order_number": "example_reference_order_number", "order_date": "example_order_date"}),
|
|
2896
|
+
(HTTPValidationError, {"detail": "example_detail"}),
|
|
2897
|
+
(ImportRequest, {"reqs": "example_reqs"}),
|
|
2898
|
+
(InCabSupplyOptionMode, {"root": "example_root"}),
|
|
2899
|
+
(InCabTripMode, {"root": "example_root"}),
|
|
2900
|
+
(InNetworkSupplyZone, {"root": "example_root"}),
|
|
2901
|
+
(InNetworkTerminal, {"root": "example_root"}),
|
|
2902
|
+
(IntegrationFormResponseOverviewReq, {"form_name": "example_form_name", "from_date": "example_from_date", "to_date": "example_to_date", "market": "example_market"}),
|
|
2903
|
+
(InvoiceAllReq, {"order_numbers": "example_order_numbers", "order_ids": "example_order_ids", "invoice_numbers": "example_invoice_numbers", "status": "example_status", "counterparty_name": "example_counterparty_name", "counterparty_id": "example_counterparty_id", "book_type": "example_book_type", "as_of": "example_as_of", "between": "example_between"}),
|
|
2904
|
+
(InvoiceDynamicStatus, {"root": "example_root"}),
|
|
2905
|
+
(InvoiceRow, {"invoice_number": "example_invoice_number", "sent_date": "example_sent_date", "when_to_send_date": "example_when_to_send_date", "created_on": "example_created_on", "type": "example_type", "status": "example_status", "transactions": "example_transactions", "note": "example_note", "base_amount": 3.14, "base_distance": 3.14, "distance_uom": "example_distance_uom", "accessorial_amount": 3.14, "surcharge_amount": 3.14, "total_amount": 3.14}),
|
|
2906
|
+
(InvoiceStaticStatus, {"root": "example_root"}),
|
|
2907
|
+
(InvoiceType, {"root": "example_root"}),
|
|
2908
|
+
(Key, {"root": "example_root"}),
|
|
2909
|
+
(LocationResponse, {"root": "example_root"}),
|
|
2910
|
+
(LocationView, {"id": "example_id", "name": "example_name", "short_name": "example_short_name", "market": "example_market", "market_id": "example_market_id", "freight_region_name": "example_freight_region_name", "freight_region_id": "example_freight_region_id", "type": "example_type", "lat": "example_lat", "lon": "example_lon", "address": "example_address", "phone": "example_phone", "city": "example_city", "state": "example_state", "active": "example_active", "postal_code": "example_postal_code", "source_id": "example_source_id", "source_system": "example_source_system", "source_system_id": "example_source_system_id", "timezone": "example_timezone", "supply_zones": "example_supply_zones", "updated_on": "example_updated_on", "cards": "example_cards", "dwells": "example_dwells", "requires_card": "example_requires_card", "geofence": "example_geofence", "supply_map": "example_supply_map", "extra_data": "example_extra_data"}),
|
|
2911
|
+
(MarketSchemaSectorView, {"root": "example_root"}),
|
|
2912
|
+
(MarketView, {"id": "example_id", "name": "example_name", "network_radius": "example_network_radius", "active": "example_active", "trailer_config": "example_trailer_config", "updated_on": "example_updated_on", "extra_data": "example_extra_data", "sectors": "example_sectors", "delivery_window_default": "example_delivery_window_default"}),
|
|
2913
|
+
(MonitoringStrategy, {"root": "example_root"}),
|
|
2914
|
+
(NOSupplyOptionResponse, {"root": "example_root"}),
|
|
2915
|
+
(OptimalSupplyReportRequest, {"order_numbers": "example_order_numbers", "order_ids": "example_order_ids", "order_date_start": "example_order_date_start", "order_date_end": "example_order_date_end", "movement_updated_start": "example_movement_updated_start", "movement_updated_end": "example_movement_updated_end", "last_change_date": "example_last_change_date"}),
|
|
2916
|
+
(OptimalSupplyReportRow, {"order_number": 42, "order_id": "example_order_id", "site_number": "example_site_number", "actual_component_product": "example_actual_component_product", "actual_component_product_id": "example_actual_component_product_id", "optimal_component_product": "example_optimal_component_product", "optimal_component_product_id": "example_optimal_component_product_id", "actual_terminal": "example_actual_terminal", "actual_terminal_id": "example_actual_terminal_id", "optimal_terminal": "example_optimal_terminal", "optimal_terminal_id": "example_optimal_terminal_id", "actual_supplier": "example_actual_supplier", "actual_supplier_id": "example_actual_supplier_id", "optimal_supplier": "example_optimal_supplier", "optimal_supplier_id": "example_optimal_supplier_id", "actual_price_type": "example_actual_price_type", "optimal_price_type": "example_optimal_price_type", "actual_contract": "example_actual_contract", "optimal_contract": "example_optimal_contract", "actual_curve_id": "example_actual_curve_id", "optimal_curve_id": "example_optimal_curve_id", "actual_price_id": "example_actual_price_id", "optimal_price_id": "example_optimal_price_id", "actual_loaded_miles": 3.14, "optimal_loaded_miles": 3.14, "actual_product_price": 3.14, "optimal_product_price": 3.14, "actual_freight_rate": 3.14, "optimal_freight_rate": 3.14, "actual_total_price": 3.14, "optimal_total_price": 3.14, "total_price_delta": 3.14, "actual_volume": 3.14, "optimal_volume": 3.14, "last_change_date": "example_last_change_date", "last_updated_date": "example_last_updated_date", "reason_code": "example_reason_code"}),
|
|
2917
|
+
(OrderCreateRequest, {"reference_order_number": "example_reference_order_number", "supply_owner": "example_supply_owner", "sourcing_strategy": "example_sourcing_strategy", "manual_supply_fallback": "example_manual_supply_fallback", "allow_alternate_products": "example_allow_alternate_products", "delivery_window": "example_delivery_window", "fit_to_trailer": "example_fit_to_trailer", "note": "example_note", "drops": "example_drops", "accept_by": "example_accept_by", "extra_data": "example_extra_data"}),
|
|
2918
|
+
(OrderCreateResponse, {"status": "example_status", "order_number": "example_order_number", "order": "example_order", "errors": "example_errors", "accept_by": "example_accept_by", "reference_order_number": "example_reference_order_number", "extra_data": "example_extra_data"}),
|
|
2919
|
+
(OrderCreateStatus, {"root": "example_root"}),
|
|
2920
|
+
(OrderDriver, {"root": "example_root"}),
|
|
2921
|
+
(OrderFreightResp, {"number": 42, "po": "example_po", "freight_rate": 3.14, "freight_total": 3.14, "freight_items": "example_freight_items"}),
|
|
2922
|
+
(OrderFreightRespV2, {"number": 42, "po": "example_po", "freight_rate": 3.14, "freight_total": 3.14, "freight_items": "example_freight_items"}),
|
|
2923
|
+
(OrderReqNotificationStates, {"root": "example_root"}),
|
|
2924
|
+
(OrderResponse, {"root": "example_root"}),
|
|
2925
|
+
(OrderSchemaBolResponse, {"root": "example_root"}),
|
|
2926
|
+
(OrderSchemaDropResponse, {"root": "example_root"}),
|
|
2927
|
+
(OrderState, {"root": "example_root"}),
|
|
2928
|
+
(OrderStatusUpdateRequest, {"order_id": "example_order_id", "order_number": "example_order_number", "status": "example_status", "location_id": "example_location_id", "eta": "example_eta", "actual": "example_actual"}),
|
|
2929
|
+
(OrderType, {"root": "example_root"}),
|
|
2930
|
+
(PayrollExportDetailModel, {"root": "example_root"}),
|
|
2931
|
+
(PayrollExportDetailResponse, {"driver_name": "example_driver_name", "driver_source_id": "example_driver_source_id", "driver_source_system": "example_driver_source_system", "end_date": "example_end_date", "hours_worked": 3.14, "pay_earned": 3.14, "payroll_config": "example_payroll_config", "start_date": "example_start_date", "status": "example_status", "updated": "example_updated", "detail": "example_detail"}),
|
|
2932
|
+
(PriceAllRequest, {"as_of": "example_as_of", "last_change_date": "example_last_change_date", "terminals": "example_terminals", "suppliers": "example_suppliers", "products": "example_products", "price_types": "example_price_types", "product_groups": "example_product_groups"}),
|
|
2933
|
+
(PriceResponse, {"curve_id": "example_curve_id", "price_id": "example_price_id", "city": "example_city", "contract": "example_contract", "product": "example_product", "product_id": "example_product_id", "supplier": "example_supplier", "supplier_id": "example_supplier_id", "counterparty": "example_counterparty", "counterparty_id": "example_counterparty_id", "terminal": "example_terminal", "terminal_id": "example_terminal_id", "store_number": "example_store_number", "store_id": "example_store_id", "price_type": "example_price_type", "product_group": "example_product_group", "price": 3.14, "effective_from": "example_effective_from", "effective_to": "example_effective_to", "expire": "example_expire", "disabled": true, "disabled_by": "example_disabled_by", "disabled_until": "example_disabled_until", "disabled_reason": "example_disabled_reason", "updated_by": "example_updated_by", "updated_on": "example_updated_on", "extra_data": "example_extra_data", "group_id": "example_group_id", "group_effective_cutover": "example_group_effective_cutover", "group_effective_cutover_timezone": "example_group_effective_cutover_timezone", "group_identifier": "example_group_identifier", "group_name": "example_group_name", "min_constraint": "example_min_constraint", "max_constraint": "example_max_constraint", "created_on": "example_created_on", "net_or_gross_type": "example_net_or_gross_type", "contract_lifting_valuation_method": "example_contract_lifting_valuation_method"}),
|
|
2934
|
+
(PriceType, {"root": "example_root"}),
|
|
2935
|
+
(ProductGroups, {"root": "example_root"}),
|
|
2936
|
+
(ProductIDName, {"root": "example_root"}),
|
|
2937
|
+
(ProductView, {"id": "example_id", "name": "example_name", "short_name": "example_short_name", "group": "example_group", "weight_group": "example_weight_group", "icon": "example_icon", "source_id": "example_source_id", "source_system": "example_source_system", "source_system_id": "example_source_system_id", "extra_data": "example_extra_data", "blends": "example_blends", "alternate_products": "example_alternate_products", "updated_on": "example_updated_on", "tank_lid_code_id": "example_tank_lid_code_id", "supply_map": "example_supply_map"}),
|
|
2938
|
+
(PydanticObjectId, {"root": "example_root"}),
|
|
2939
|
+
(RateBookType, {"root": "example_root"}),
|
|
2940
|
+
(RootModel, {"root": "example_root"}),
|
|
2941
|
+
(RouteUpsertReq, {"origin_name": "example_origin_name", "destination_name": "example_destination_name", "api_distance_miles": "example_api_distance_miles", "api_travel_time_seconds": "example_api_travel_time_seconds", "override_travel_time_seconds": "example_override_travel_time_seconds", "override_distance_miles": "example_override_distance_miles", "override_payroll_miles": "example_override_payroll_miles"}),
|
|
2942
|
+
(SalesAdjustedDeliveryUpsertReq, {"source": "example_source", "store_id": "example_store_id", "tank_id": "example_tank_id", "product_id": "example_product_id", "volume": 3.14, "date": "example_date"}),
|
|
2943
|
+
(SaveDropDetail, {"root": "example_root"}),
|
|
2944
|
+
(SaveDropMode, {"root": "example_root"}),
|
|
2945
|
+
(SaveDropReq, {"mode": "example_mode", "order_id": "example_order_id", "location_id": "example_location_id", "details": "example_details"}),
|
|
2946
|
+
(Shift, {"root": "example_root"}),
|
|
2947
|
+
(SourceMap, {"root": "example_root"}),
|
|
2948
|
+
(SourcingStrategy, {"root": "example_root"}),
|
|
2949
|
+
(StatusUpdate, {"root": "example_root"}),
|
|
2950
|
+
(StoreStatus, {"root": "example_root"}),
|
|
2951
|
+
(StoreTank, {"root": "example_root"}),
|
|
2952
|
+
(StoreV2, {"field_id": "example_field_id", "store_number": "example_store_number", "name": "example_name", "market": "example_market", "market_id": "example_market_id", "sector": "example_sector", "sector_id": "example_sector_id", "tanks": "example_tanks", "lat": "example_lat", "lon": "example_lon", "address": "example_address", "city": "example_city", "state": "example_state", "postal_code": "example_postal_code", "contact_name": "example_contact_name", "phone_number": "example_phone_number", "emails": "example_emails", "hours": "example_hours", "timezone": "example_timezone", "status": "example_status", "drop_workflow": "example_drop_workflow", "open_date": "example_open_date", "close_date": "example_close_date", "unavailable_hours": "example_unavailable_hours", "counterparty_id": "example_counterparty_id", "counterparty_name": "example_counterparty_name", "in_network_terminals": "example_in_network_terminals", "in_network_supply_zones": "example_in_network_supply_zones", "supply_owner_id": "example_supply_owner_id", "supply_owner_name": "example_supply_owner_name", "freight_customer_id": "example_freight_customer_id", "freight_customer_name": "example_freight_customer_name", "freight_region_name": "example_freight_region_name", "freight_region_id": "example_freight_region_id", "layout_file": "example_layout_file", "layout_file_uploaded": "example_layout_file_uploaded", "auto_order_disabled": "example_auto_order_disabled", "updated_id": "example_updated_id", "trailer_config": "example_trailer_config", "monitoring_strategy": "example_monitoring_strategy", "estick_monitor_override": "example_estick_monitor_override", "notes": "example_notes", "updated_on": "example_updated_on", "updated_by": "example_updated_by", "extra_data": "example_extra_data", "credit_hold": "example_credit_hold", "compliance_hold_date": "example_compliance_hold_date", "delivery_window_default_name": "example_delivery_window_default_name", "delivery_window_default_id": "example_delivery_window_default_id", "allow_by_product_request": "example_allow_by_product_request", "geofence": "example_geofence"}),
|
|
2953
|
+
(SupplyPriceUpdateManyRequest, {"id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "contract": "example_contract", "timezone": "example_timezone", "effective_from": "example_effective_from", "effective_to": "example_effective_to", "price": 3.14, "price_type": "example_price_type", "terminal_id": "example_terminal_id", "terminal_source_id": "example_terminal_source_id", "terminal_source_system_id": "example_terminal_source_system_id", "terminal": "example_terminal", "product_id": "example_product_id", "product_source_id": "example_product_source_id", "product_source_system_id": "example_product_source_system_id", "product": "example_product", "supplier_id": "example_supplier_id", "supplier_source_id": "example_supplier_source_id", "supplier_source_system_id": "example_supplier_source_system_id", "supplier": "example_supplier", "counterparty_id": "example_counterparty_id", "counterparty_source_id": "example_counterparty_source_id", "counterparty_source_system_id": "example_counterparty_source_system_id", "counterparty": "example_counterparty", "store_id": "example_store_id", "store_source_id": "example_store_source_id", "store_source_system_id": "example_store_source_system_id", "store_number": "example_store_number", "enabled": "example_enabled", "disabled_until": "example_disabled_until", "expire": "example_expire", "min_quantity": "example_min_quantity", "max_quantity": "example_max_quantity", "curve_id": "example_curve_id", "error": "example_error", "row": "example_row", "net_or_gross_type": "example_net_or_gross_type", "contract_lifting_valuation_method": "example_contract_lifting_valuation_method"}),
|
|
2954
|
+
(SupplyPriceUpdateResponse, {"root": "example_root"}),
|
|
2955
|
+
(SurchargeAllReq, {"counterparty_name": "example_counterparty_name", "counterparty_id": "example_counterparty_id", "book_type": "example_book_type", "as_of": "example_as_of", "product_group": "example_product_group", "freight_region_name": "example_freight_region_name", "freight_region_id": "example_freight_region_id"}),
|
|
2956
|
+
(SurchargeAllResp, {"id": "example_id", "counterparty": "example_counterparty", "counterparty_id": "example_counterparty_id", "product_group": "example_product_group", "book_type": "example_book_type", "freight_region_id": "example_freight_region_id", "freight_region_name": "example_freight_region_name", "type": "example_type", "effective_from": "example_effective_from", "effective_to": "example_effective_to", "surcharge": "example_surcharge", "created_on": "example_created_on", "created_by": "example_created_by"}),
|
|
2957
|
+
(SurchargeCreateReq, {"counterparty_name": "example_counterparty_name", "counterparty_id": "example_counterparty_id", "product_group": "example_product_group", "book_type": "example_book_type", "freight_region_id": "example_freight_region_id", "freight_region_name": "example_freight_region_name", "type": "example_type", "effective_from": "example_effective_from", "effective_to": "example_effective_to", "surcharge": "example_surcharge"}),
|
|
2958
|
+
(SurchargeType, {"root": "example_root"}),
|
|
2959
|
+
(SurchargeUpdateReq, {"id": "example_id", "effective_from": "example_effective_from", "effective_to": "example_effective_to", "surcharge": "example_surcharge"}),
|
|
2960
|
+
(TankLidEnum, {"root": "example_root"}),
|
|
2961
|
+
(TerminalType, {"root": "example_root"}),
|
|
2962
|
+
(TimezoneEnum, {"root": "example_root"}),
|
|
2963
|
+
(TractorView, {"id": "example_id", "tractor_number": "example_tractor_number", "depot": "example_depot", "vin": "example_vin", "model": "example_model", "make": "example_make", "year": "example_year", "weight": "example_weight", "next_maintenance": "example_next_maintenance", "next_tractor_maintenance_required": "example_next_tractor_maintenance_required", "updated_on": "example_updated_on", "extra_data": "example_extra_data"}),
|
|
2964
|
+
(TrailerConfigMatrixView, {"id": "example_id", "importance": 42, "trailer_config": "example_trailer_config", "code": "example_code", "values": "example_values", "updated_on": "example_updated_on"}),
|
|
2965
|
+
(TrailerView, {"id": "example_id", "trailer_number": "example_trailer_number", "configuration": "example_configuration", "depot": "example_depot", "make": "example_make", "model": "example_model", "weight": "example_weight", "updated_on": "example_updated_on", "extra_data": "example_extra_data"}),
|
|
2966
|
+
(UnavailableHours, {"root": "example_root"}),
|
|
2967
|
+
(UnavailableHoursRequest, {"root": "example_root"}),
|
|
2968
|
+
(UpdateResponse, {"created": "example_created", "end_dated": "example_end_dated", "bad_data": "example_bad_data", "duplicates": "example_duplicates", "exact_match": "example_exact_match"}),
|
|
2969
|
+
(UploadIMSRequest, {"store": "example_store", "tank": "example_tank", "timezone": "example_timezone", "date": "example_date", "inches": "example_inches", "volume": "example_volume", "payload": "example_payload"}),
|
|
2970
|
+
(UpsertLocationRequest, {"id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "name": "example_name", "short_name": "example_short_name", "address": "example_address", "type": "example_type", "city": "example_city", "state": "example_state", "postal_code": "example_postal_code", "market_id": "example_market_id", "market": "example_market", "lat": 3.14, "lon": 3.14, "hours": "example_hours", "contact": "example_contact", "contact_phone": "example_contact_phone", "active": "example_active", "include_in_backhaul": "example_include_in_backhaul", "start_time": "example_start_time", "end_time": "example_end_time", "requires_card": "example_requires_card", "splash_blending": "example_splash_blending", "split_load_terminals": "example_split_load_terminals", "authorized_carriers": "example_authorized_carriers", "extra_data": "example_extra_data", "geofence": "example_geofence", "supply_zones": "example_supply_zones", "supply_map": "example_supply_map"}),
|
|
2971
|
+
(UpsertManyCounterpartyRequest, {"id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "name": "example_name", "types": "example_types", "carrier_type": "example_carrier_type", "trailer_config": "example_trailer_config", "emails": "example_emails", "sourcing_strategy": "example_sourcing_strategy", "extra_data": "example_extra_data", "goid": "example_goid", "allow_short_loads": "example_allow_short_loads", "order_notification_preferences": "example_order_notification_preferences", "supply_map": "example_supply_map", "available_credit": "example_available_credit", "hold": "example_hold"}),
|
|
2972
|
+
(UpsertManyDriverRequest, {"id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "name": "example_name", "username": "example_username", "email": "example_email", "title": "example_title", "hire_date": "example_hire_date", "termination_date": "example_termination_date", "depot": "example_depot", "depot_id": "example_depot_id", "in_cab_trip_mode": "example_in_cab_trip_mode", "in_cab_supply_option_mode": "example_in_cab_supply_option_mode", "preferred_template": "example_preferred_template", "shift_preference": "example_shift_preference", "shift_length_hours": "example_shift_length_hours", "tractor_number": "example_tractor_number", "tractor_id": "example_tractor_id", "trailer_number": "example_trailer_number", "trailer_id": "example_trailer_id", "carded_terminals": "example_carded_terminals", "supervisor": "example_supervisor", "active": "example_active"}),
|
|
2973
|
+
(UpsertManyStoreRequest, {"id": "example_id", "store_number": "example_store_number", "name": "example_name", "address": "example_address", "city": "example_city", "state": "example_state", "postal_code": "example_postal_code", "phone_number": "example_phone_number", "emails": "example_emails", "hours": "example_hours", "market": "example_market", "market_id": "example_market_id", "sector": "example_sector", "sector_id": "example_sector_id", "trailer_config": "example_trailer_config", "lat": 3.14, "lon": 3.14, "timezone": "example_timezone", "status": "example_status", "contact_name": "example_contact_name", "open_date": "example_open_date", "close_date": "example_close_date", "unavailable_hours": "example_unavailable_hours", "counterparty_id": "example_counterparty_id", "counterparty_name": "example_counterparty_name", "supply_owner_id": "example_supply_owner_id", "supply_owner_name": "example_supply_owner_name", "freight_customer_id": "example_freight_customer_id", "freight_customer_name": "example_freight_customer_name", "freight_region_name": "example_freight_region_name", "freight_region_id": "example_freight_region_id", "extra_data": "example_extra_data", "monitoring_strategy": "example_monitoring_strategy", "estick_monitor_override": "example_estick_monitor_override", "drop_workflow": "example_drop_workflow", "credit_hold": "example_credit_hold", "compliance_hold_date": "example_compliance_hold_date", "allow_by_product_request": "example_allow_by_product_request", "in_network_terminals": "example_in_network_terminals", "delivery_window_default_name": "example_delivery_window_default_name", "delivery_window_default_id": "example_delivery_window_default_id", "geofence": "example_geofence"}),
|
|
2974
|
+
(UpsertProductRequest, {"group": "example_group", "weight_group": "example_weight_group", "extra_data": "example_extra_data", "id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "name": "example_name", "alias": "example_alias", "enabled": "example_enabled", "specific_gravity": "example_specific_gravity", "short_name": "example_short_name", "icon": "example_icon", "tank_lid_code_id": "example_tank_lid_code_id", "supply_map": "example_supply_map"}),
|
|
2975
|
+
(UpsertTankRequest, {"id": "example_id", "source_id": "example_source_id", "source_system_id": "example_source_system_id", "store_id": "example_store_id", "tank_id": "example_tank_id", "island": "example_island", "icon": "example_icon", "product_id": "example_product_id", "product": "example_product", "description": "example_description", "tank_chart": "example_tank_chart", "storage_max": "example_storage_max", "tank_size": "example_tank_size", "fuel_bottom": "example_fuel_bottom", "manufacturer": "example_manufacturer", "dimensions": "example_dimensions", "tank_color": "example_tank_color", "minimum_load_size": "example_minimum_load_size", "maximum_load_size": "example_maximum_load_size", "strapping_table": "example_strapping_table", "target_min": "example_target_min", "target_max": "example_target_max", "inventory_strategy": "example_inventory_strategy", "load_tags": "example_load_tags", "filter_tags": "example_filter_tags", "split_me": "example_split_me", "water_reading_requirement": "example_water_reading_requirement", "requires_pump": "example_requires_pump", "carrier_id": "example_carrier_id", "carrier": "example_carrier", "extra_data": "example_extra_data", "active": "example_active", "manifold_id": "example_manifold_id", "apportion_percentage": "example_apportion_percentage", "compliance_hold": "example_compliance_hold", "demand_model_tank_profile": "example_demand_model_tank_profile", "store_number": "example_store_number"}),
|
|
2976
|
+
(UpsertTractorReq, {"id": "example_id", "tractor_number": "example_tractor_number", "depot": "example_depot", "vin": "example_vin", "make": "example_make", "model": "example_model", "year": "example_year", "weight": "example_weight", "next_maintenance": "example_next_maintenance", "next_tractor_maintenance_required": "example_next_tractor_maintenance_required", "source_id": "example_source_id", "source_system_id": "example_source_system_id"}),
|
|
2977
|
+
(UpsertTractorResp, {"created": "example_created", "updated": "example_updated", "errors": "example_errors"}),
|
|
2978
|
+
(UpsertTrailerReq, {"id": "example_id", "trailer_number": "example_trailer_number", "configuration": "example_configuration", "depot": "example_depot", "make": "example_make", "model": "example_model", "weight": "example_weight", "source_id": "example_source_id", "source_system_id": "example_source_system_id"}),
|
|
2979
|
+
(UpsertTrailerResp, {"created": "example_created", "updated": "example_updated", "errors": "example_errors"}),
|
|
2980
|
+
(ValidationError, {"root": "example_root"}),
|
|
2981
|
+
(VolumeDistributionRequest, {"root": "example_root"}),
|
|
2982
|
+
(WaterReadingRequirement, {"root": "example_root"}),
|
|
2983
|
+
|
|
2984
|
+
])
|
|
2985
|
+
def test_all_models_validation(model_class: BaseModel, example_input: Dict[str, Any]):
|
|
2986
|
+
"""Parametrized test for all models."""
|
|
2987
|
+
generic_model_validation_test(model_class, example_input)
|