Skip to content

Commit

Permalink
test all
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Nov 15, 2024
1 parent 51a44ee commit 6b575c2
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@ def test_car_information_data():
# Verify expected attributes
assert data is not None
assert isinstance(data, CarInformationData)
assert data.model_name == "Polestar 3"
assert data.vin == "YSMYKEAE7RB000000"
assert data.internal_vehicle_identifier == "1aaeb452-700e-46f3-9899-395b6219c8a6"
assert data.registration_no == "MLB007"
assert data.registration_date is None
assert data.factory_complete_date == date(year=2024, month=4, day=16)
assert data.model_name == "Polestar 3"
assert (
data.image_url
== "https://cas.polestar.com/image/dynamic/MY24_2207/359/summary-transparent-v2/EA/1/72300/R80000/R102/LR02/EV02/K503/JB07/SW01/_/ET01/default.png?market=se"
)
assert data.battery == "400V lithium-ion battery, 111 kWh capacity, 17 modules"
assert data.torque == "840 Nm / 620 lbf-ft"
assert data.software_version is None


def test_car_information_data_invalid():
Expand All @@ -41,11 +50,16 @@ def test_car_battery_data():
assert isinstance(data, CarBatteryData)
assert data.average_energy_consumption_kwh_per_100km == 22.4
assert data.battery_charge_level_percentage == 34
assert data.charging_status == ChargingStatus.CHARGING_STATUS_IDLE
assert (
data.charger_connection_status
== ChargingConnectionStatus.CHARGER_CONNECTION_STATUS_DISCONNECTED
)
assert data.charging_current_amps == 0
assert data.charging_power_watts == 0
assert data.charging_status == ChargingStatus.CHARGING_STATUS_IDLE
assert data.estimated_charging_time_minutes_to_target_distance == 0
assert data.estimated_charging_time_to_full_minutes == 0
assert data.estimated_distance_to_empty_km == 150
assert data.event_updated_timestamp == datetime(
year=2024,
month=11,
Expand All @@ -72,6 +86,8 @@ def test_car_odometer_data():
assert data.average_speed_km_per_hour == 42.0
assert data.event_updated_timestamp.timestamp() == 1731338116
assert data.trip_meter_automatic_km == 4.2
assert data.trip_meter_manual_km == 1984.0
assert data.odometer_meters == 2001000


def test_car_odometer_data_invalid():
Expand Down

0 comments on commit 6b575c2

Please sign in to comment.