Exemple #1
0
 def test_get_all_makes(self, typed_client: TypedClient, responses):
     makes: List[Make] = typed_client.get_all_makes()
     assert len(makes) == 9628
     assert makes[0].make == "ASTON MARTIN"
     assert makes[0].make_id == 440
     assert makes[1].make == "TESLA"
     assert makes[1].make_id == 441
 def test_get_vehicle_variable_values_list(self, typed_client: TypedClient,
                                           responses):
     values: List[Value] = typed_client.get_vehicle_variable_values_list(
         "Vehicle Type")
     assert len(values) == 9
     assert values[0].id == 1
     assert values[0].name == "Motorcycle"
Exemple #3
0
 def test_decode_vin_with_model_year(self, typed_client: TypedClient,
                                     responses):
     vehicle = typed_client.decode_vin("1FTMW1T88MFA00001", 2021)
     assert vehicle.make == "FORD"
     assert vehicle.model == "F-150"
     assert vehicle.trim == "SuperCrew-SSV"
     assert vehicle.vehicle_type == "TRUCK "
Exemple #4
0
 def test_get_manufacturer_details_by_partial_name(
         self, typed_client: TypedClient, responses):
     details: List[
         ManufacturerDetail] = typed_client.get_manufacturer_details(
             "METRO")
     assert details[0].manufacturer_id == 3382
     assert details[0].manufacturer == "NICHIBEI METROPAGES, INC."
     assert details[0].manufacturer_common_name is None
Exemple #5
0
    def test_get_manufacturer_details_name(self, typed_client: TypedClient,
                                           responses):
        details: List[
            ManufacturerDetail] = typed_client.get_manufacturer_details(
                "Honda")

        assert details[0].manufacturer_id == 987
        assert details[0].manufacturer == "HONDA MOTOR CO., LTD"
        assert details[0].manufacturer_common_name == "Honda"
 def test_get_vehicle_variable_list(self, typed_client: TypedClient,
                                    responses):
     variables: List[Variable] = typed_client.get_vehicle_variable_list()
     assert len(variables) == 138
     assert hasattr(variables[0], "data_type")
     assert hasattr(variables[0], "description")
     assert hasattr(variables[0], "group_name")
     assert hasattr(variables[0], "id")
     assert hasattr(variables[0], "name")
     assert variables[0].id == 1
Exemple #7
0
 def test_decode_wmi(self, typed_client: TypedClient, responses):
     wmi: WMI = typed_client.decode_wmi("1FT")
     assert wmi.common_name == "Ford"
     assert wmi.created_on == "2015-03-23"
     assert wmi.date_available_to_public == "2015-01-01"
     assert wmi.make == "FORD"
     assert wmi.manufacturer == "FORD MOTOR COMPANY, USA"
     assert wmi.parent_company_name == ""
     assert wmi.updated_on is None
     assert wmi.url == "http://www.ford.com/"
     assert wmi.vehicle_type == "Truck "
Exemple #8
0
 def test_get_manufacturer_details(self, typed_client: TypedClient,
                                   responses):
     details: List[
         ManufacturerDetail] = typed_client.get_manufacturer_details(988)
     assert len(details) == 1
     honda = details[0]
     assert honda.manufacturer_id == 988
     assert (honda.manufacturer ==
             "HONDA DEVELOPMENT & MANUFACTURING OF AMERICA, LLC")
     assert honda.manufacturer_common_name == "Honda"
     assert honda.manufacturer_types is not None
     if honda.manufacturer_types is not None:
         assert honda.manufacturer_types[
             0].name == "Completed Vehicle Manufacturer"
Exemple #9
0
    def test_decode_vin_batch(self, typed_client: TypedClient, responses):
        vehicles = typed_client.decode_vin_batch(
            ["5UXWX7C5*BA,2011", "5YJSA3DS*EF"])

        bmw = vehicles[0]
        assert bmw.model_year == "2011"
        assert bmw.make == "BMW"
        assert bmw.model == "X3"
        assert bmw.trim == "xDrive35i"
        assert bmw.vehicle_type == "MULTIPURPOSE PASSENGER VEHICLE (MPV)"

        tesla = vehicles[1]
        assert tesla.model_year == "2014"
        assert tesla.make == "TESLA"
        assert tesla.model == "Model S"
        assert tesla.trim == "w/DC Fast Charge"
        assert tesla.vehicle_type == "PASSENGER CAR"
Exemple #10
0
 def test_get_makes_for_vehicle_type(self, typed_client: TypedClient,
                                     responses):
     makes: List[Make] = typed_client.get_makes_for_vehicle_type("Car")
     assert len(makes) == 167
Exemple #11
0
 def test_get_vehicle_types_for_make_name(self, typed_client: TypedClient,
                                          responses):
     types: List[VehicleType] = typed_client.get_vehicle_types_for_make(
         "kia")
     assert len(types) == 3
Exemple #12
0
 def test_get_parts_566(self, typed_client: TypedClient, responses):
     documents: List[Document] = typed_client.get_parts(
         "566", "2016-02-01", "2016-02-15", 1)
     assert len(documents) == 15
Exemple #13
0
 def test_get_parts_565(self, typed_client: TypedClient, responses):
     documents: List[Document] = typed_client.get_parts(
         "565", "2015-01-01", "2015-05-05", 1)
     assert len(documents) == 175
Exemple #14
0
 def test_get_wmis_for_manufacturerid(self, typed_client: TypedClient,
                                      responses):
     wmis: List[WMI] = typed_client.get_wmis_for_manufacturer(988)
     assert len(wmis) == 20
Exemple #15
0
 def test_get_models_for_make_year_vehicletype(self,
                                               typed_client: TypedClient,
                                               responses):
     models: List[Model] = typed_client.get_models_for_make(
         "TESLA", model_year=2020, vehicle_type="Car")
     assert len(models) == 4
Exemple #16
0
 def test_get_makes_for_manufacturer_by_partial_name(
         self, typed_client: TypedClient, responses):
     makes: List[Make] = typed_client.get_makes_for_manufacturer("METRO")
     assert len(makes) == 4
Exemple #17
0
 def test_get_vehicle_variable_values_list(self, typed_client: TypedClient):
     values: List[Value] = typed_client.get_vehicle_variable_values_list(
         "Vehicle Type")
     pass
Exemple #18
0
 def test_get_wmis_for_manufacturer_partialname(self,
                                                typed_client: TypedClient,
                                                responses):
     wmis: List[WMI] = typed_client.get_wmis_for_manufacturer("TECHNOLOG")
     assert len(wmis) == 101
Exemple #19
0
 def test_get_wmis_for_manufacturer_name(self, typed_client: TypedClient,
                                         responses):
     wmis: List[WMI] = typed_client.get_wmis_for_manufacturer("Honda")
     assert len(wmis) == 44
Exemple #20
0
 def test_get_models_for_makeid(self, typed_client: TypedClient, responses):
     models: List[Model] = typed_client.get_models_for_make(441)
     assert len(models) == 5
Exemple #21
0
 def test_get_canadian_vehicle_specifications(self,
                                              typed_client: TypedClient,
                                              responses):
     models: List[Model] = typed_client.get_canadian_vehicle_specifications(
         2011, make="Acura", model="", units="")
     assert len(models) == 10
Exemple #22
0
 def test_get_makes_for_manufacturerid_and_modelyear(
         self, typed_client: TypedClient, responses):
     makes: List[Make] = typed_client.get_makes_for_manufacturer(988, 2021)
     assert len(makes) == 2
Exemple #23
0
 def test_decode_partial_vin(self, typed_client: TypedClient, responses):
     vehicle = typed_client.decode_vin("5UXWX7C5*BA", 2011)
     assert vehicle.make == "BMW"
     assert vehicle.model == "X3"
     assert vehicle.trim == "xDrive35i"
     assert vehicle.vehicle_type == "MULTIPURPOSE PASSENGER VEHICLE (MPV)"
Exemple #24
0
 def test_get_models_for_makeid_vehicletype(self, typed_client: TypedClient,
                                            responses):
     models: List[Model] = typed_client.get_models_for_make(
         441, vehicle_type="Car")
     assert len(models) == 5
Exemple #25
0
 def test_get_equipment_plant_codes(self, typed_client: TypedClient,
                                    responses):
     plant_codes: List[PlantCode] = typed_client.get_equipment_plant_codes(
         2016, 1)
     assert len(plant_codes) == 1091
     assert hasattr(plant_codes[0], "dot_code")
Exemple #26
0
 def test_get_models_for_make_year(self, typed_client: TypedClient,
                                   responses):
     models: List[Model] = typed_client.get_models_for_make("TESLA",
                                                            model_year=2020)
     assert len(models) == 4
Exemple #27
0
 def test_get_makes_for_vehicle_type(self, typed_client: TypedClient):
     makes: List[Make] = typed_client.get_makes_for_vehicle_type("Truck ")
     pass
Exemple #28
0
 def test_get_makes_for_manufacturer(self, typed_client: TypedClient,
                                     responses):
     makes: List[Make] = typed_client.get_makes_for_manufacturer(988)
     assert len(makes) == 2