from .helper_methods import get_object_for_comparison


def test_dmr_object_normal_car():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]
    

def test_dmr_object_electric_car():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]


def test_dmr_object_plugin_hybrid_car():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]


def test_dmr_object_hydrogen_car():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]


def test_dmr_object_van():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]


def test_dmr_object_motorcycle():
    dmr, expected = get_object_for_comparison("cw87553", False)
    assert dmr.make == expected["make"]
    assert dmr.model == expected["model"]
    assert dmr.variant == expected["variant"]
    assert dmr.vin == expected["vin"]
    assert dmr.type == expected["type"]
    assert dmr.last_update == expected["last_update"]
    assert dmr.registration_number == expected["registration_number"]
    assert dmr.first_registration == expected["first_registration"]
    assert dmr.use == expected["use"]
    assert dmr.vehicle_id == expected["vehicle_id"]
    assert dmr.color == expected["color"]
    assert dmr.model_year == expected["model_year"]
    assert dmr.total_weight == expected["total_weight"]
    assert dmr.vehicle_weight == expected["vehicle_weight"]
    assert dmr.propulsion == expected["propulsion"]
    assert dmr.tow_bar == expected["tow_bar"]
    assert dmr.fuel_consumption == expected["fuel_consumption"]
    assert dmr.cylinders == expected["cylinders"]
    assert dmr.plugin_hybrid == expected["plugin_hybrid"]
    assert dmr.electricity_consumption == expected["electricity_consumption"]
    assert dmr.electric_range == expected["electric_range"]
    assert dmr.battery_capacity == expected["battery_capacity"]
    assert dmr.body_type == expected["body_type"]
    assert dmr.particle_filter == expected["particle_filter"]
    assert dmr.doors == expected["doors"]
    assert dmr.insurance.company == expected["insurance"]["company"]
    assert dmr.insurance.created == expected["insurance"]["created"]
    assert dmr.insurance.is_active == expected["insurance"]["is_active"]
    assert dmr.insurance.number == expected["insurance"]["number"]