from .helper_methods import get_data_for_comparison


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


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


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


def test_hydrogen_car():
    recieved, expected = get_data_for_comparison("cy41511", True)
    assert recieved["make"] == expected["make"]
    assert recieved["model"] == expected["model"]
    assert recieved["variant"] == expected["variant"]
    assert recieved["vin"] == expected["vin"]
    assert recieved["type"] == expected["type"]
    assert recieved["last_update"] == expected["last_update"]
    assert recieved["registration_number"] == expected["registration_number"]
    assert recieved["first_registration"] == expected["first_registration"]
    assert recieved["use"] == expected["use"]
    assert recieved["vehicle_id"] == expected["vehicle_id"]
    assert recieved["color"] == expected["color"]
    assert recieved["model_year"] == expected["model_year"]
    assert recieved["total_weight"] == expected["total_weight"]
    assert recieved["vehicle_weight"] == expected["vehicle_weight"]
    assert recieved["propulsion"] == expected["propulsion"]
    assert recieved["tow_bar"] == expected["tow_bar"]
    assert recieved["fuel_consumption"] == expected["fuel_consumption"]
    assert recieved["cylinders"] == expected["cylinders"]
    assert recieved["plugin_hybrid"] == expected["plugin_hybrid"]
    assert recieved["electricity_consumption"] == expected["electricity_consumption"]
    assert recieved["electric_range"] == expected["electric_range"]
    assert recieved["battery_capacity"] == expected["battery_capacity"]
    assert recieved["body_type"] == expected["body_type"]
    assert recieved["particle_filter"] == expected["particle_filter"]
    assert recieved["doors"] == expected["doors"]
    assert recieved["insurance"]["company"] == expected["insurance"]["company"]
    assert recieved["insurance"]["created"] == expected["insurance"]["created"]
    assert recieved["insurance"]["is_active"] == expected["insurance"]["is_active"]
    assert recieved["insurance"]["number"] == expected["insurance"]["number"]


def test_van():
    recieved, expected = get_data_for_comparison("ap22698", True)
    assert recieved["make"] == expected["make"]
    assert recieved["model"] == expected["model"]
    assert recieved["variant"] == expected["variant"]
    assert recieved["vin"] == expected["vin"]
    assert recieved["type"] == expected["type"]
    assert recieved["last_update"] == expected["last_update"]
    assert recieved["registration_number"] == expected["registration_number"]
    assert recieved["first_registration"] == expected["first_registration"]
    assert recieved["use"] == expected["use"]
    assert recieved["vehicle_id"] == expected["vehicle_id"]
    assert recieved["color"] == expected["color"]
    assert recieved["model_year"] == expected["model_year"]
    assert recieved["total_weight"] == expected["total_weight"]
    assert recieved["vehicle_weight"] == expected["vehicle_weight"]
    assert recieved["propulsion"] == expected["propulsion"]
    assert recieved["tow_bar"] == expected["tow_bar"]
    assert recieved["fuel_consumption"] == expected["fuel_consumption"]
    assert recieved["cylinders"] == expected["cylinders"]
    assert recieved["plugin_hybrid"] == expected["plugin_hybrid"]
    assert recieved["electricity_consumption"] == expected["electricity_consumption"]
    assert recieved["electric_range"] == expected["electric_range"]
    assert recieved["battery_capacity"] == expected["battery_capacity"]
    assert recieved["body_type"] == expected["body_type"]
    assert recieved["particle_filter"] == expected["particle_filter"]
    assert recieved["doors"] == expected["doors"]
    assert recieved["insurance"]["company"] == expected["insurance"]["company"]
    assert recieved["insurance"]["created"] == expected["insurance"]["created"]
    assert recieved["insurance"]["is_active"] == expected["insurance"]["is_active"]
    assert recieved["insurance"]["number"] == expected["insurance"]["number"]


def test_motorcycle():
    recieved, expected = get_data_for_comparison("ca20548", True)
    assert recieved["make"] == expected["make"]
    assert recieved["model"] == expected["model"]
    assert recieved["variant"] == expected["variant"]
    assert recieved["vin"] == expected["vin"]
    assert recieved["type"] == expected["type"]
    assert recieved["last_update"] == expected["last_update"]
    assert recieved["registration_number"] == expected["registration_number"]
    assert recieved["first_registration"] == expected["first_registration"]
    assert recieved["use"] == expected["use"]
    assert recieved["vehicle_id"] == expected["vehicle_id"]
    assert recieved["color"] == expected["color"]
    assert recieved["model_year"] == expected["model_year"]
    assert recieved["total_weight"] == expected["total_weight"]
    assert recieved["vehicle_weight"] == expected["vehicle_weight"]
    assert recieved["propulsion"] == expected["propulsion"]
    assert recieved["tow_bar"] == expected["tow_bar"]
    assert recieved["fuel_consumption"] == expected["fuel_consumption"]
    assert recieved["cylinders"] == expected["cylinders"]
    assert recieved["plugin_hybrid"] == expected["plugin_hybrid"]
    assert recieved["electricity_consumption"] == expected["electricity_consumption"]
    assert recieved["electric_range"] == expected["electric_range"]
    assert recieved["battery_capacity"] == expected["battery_capacity"]
    assert recieved["body_type"] == expected["body_type"]
    assert recieved["particle_filter"] == expected["particle_filter"]
    assert recieved["doors"] == expected["doors"]
    assert recieved["insurance"]["company"] == expected["insurance"]["company"]
    assert recieved["insurance"]["created"] == expected["insurance"]["created"]
    assert recieved["insurance"]["is_active"] == expected["insurance"]["is_active"]
    assert recieved["insurance"]["number"] == expected["insurance"]["number"]