| 1 |
# flake8: noqa |
| 2 |
from ocpp.v16.enums import * |
| 3 |
|
| 4 |
|
| 5 |
def test_authorization_status(): |
| 6 |
assert AuthorizationStatus.accepted == "Accepted" |
| 7 |
assert AuthorizationStatus.blocked == "Blocked" |
| 8 |
assert AuthorizationStatus.expired == "Expired" |
| 9 |
assert AuthorizationStatus.invalid == "Invalid" |
| 10 |
assert AuthorizationStatus.concurrent_tx == "ConcurrentTx" |
| 11 |
|
| 12 |
|
| 13 |
def test_availability_status(): |
| 14 |
assert AvailabilityStatus.accepted == "Accepted" |
| 15 |
assert AvailabilityStatus.rejected == "Rejected" |
| 16 |
assert AvailabilityStatus.scheduled == "Scheduled" |
| 17 |
|
| 18 |
|
| 19 |
def test_availability_type(): |
| 20 |
assert AvailabilityType.inoperative == "Inoperative" |
| 21 |
assert AvailabilityType.operative == "Operative" |
| 22 |
|
| 23 |
|
| 24 |
def test_cancel_reservation_status(): |
| 25 |
assert CancelReservationStatus.accepted == "Accepted" |
| 26 |
assert CancelReservationStatus.rejected == "Rejected" |
| 27 |
|
| 28 |
|
| 29 |
def test_charge_point_error_code(): |
| 30 |
assert ChargePointErrorCode.connector_lock_failure == "ConnectorLockFailure" |
| 31 |
assert ChargePointErrorCode.ev_communication_error == "EVCommunicationError" |
| 32 |
assert ChargePointErrorCode.ground_failure == "GroundFailure" |
| 33 |
assert ChargePointErrorCode.high_temperature == "HighTemperature" |
| 34 |
assert ChargePointErrorCode.internal_error == "InternalError" |
| 35 |
assert ChargePointErrorCode.local_list_conflict == "LocalListConflict" |
| 36 |
assert ChargePointErrorCode.no_error == "NoError" |
| 37 |
assert ChargePointErrorCode.other_error == "OtherError" |
| 38 |
assert ChargePointErrorCode.over_current_failure == "OverCurrentFailure" |
| 39 |
assert ChargePointErrorCode.over_voltage == "OverVoltage" |
| 40 |
assert ChargePointErrorCode.power_meter_failure == "PowerMeterFailure" |
| 41 |
assert ChargePointErrorCode.power_switch_failure == "PowerSwitchFailure" |
| 42 |
assert ChargePointErrorCode.reader_failure == "ReaderFailure" |
| 43 |
assert ChargePointErrorCode.reset_failure == "ResetFailure" |
| 44 |
assert ChargePointErrorCode.under_voltage == "UnderVoltage" |
| 45 |
assert ChargePointErrorCode.weak_signal == "WeakSignal" |
| 46 |
|
| 47 |
|
| 48 |
def test_charge_point_status(): |
| 49 |
assert ChargePointStatus.available == "Available" |
| 50 |
assert ChargePointStatus.preparing == "Preparing" |
| 51 |
assert ChargePointStatus.charging == "Charging" |
| 52 |
assert ChargePointStatus.suspended_evse == "SuspendedEVSE" |
| 53 |
assert ChargePointStatus.suspended_ev == "SuspendedEV" |
| 54 |
assert ChargePointStatus.finishing == "Finishing" |
| 55 |
assert ChargePointStatus.reserved == "Reserved" |
| 56 |
assert ChargePointStatus.unavailable == "Unavailable" |
| 57 |
assert ChargePointStatus.faulted == "Faulted" |
| 58 |
|
| 59 |
|
| 60 |
def test_charging_profile_kind_type(): |
| 61 |
assert ChargingProfileKindType.absolute == "Absolute" |
| 62 |
assert ChargingProfileKindType.recurring == "Recurring" |
| 63 |
assert ChargingProfileKindType.relative == "Relative" |
| 64 |
|
| 65 |
|
| 66 |
def test_charging_profile_purpose_type(): |
| 67 |
assert ( |
| 68 |
ChargingProfilePurposeType.charge_point_max_profile == "ChargePointMaxProfile" |
| 69 |
) |
| 70 |
assert ChargingProfilePurposeType.tx_default_profile == "TxDefaultProfile" |
| 71 |
assert ChargingProfilePurposeType.tx_profile == "TxProfile" |
| 72 |
|
| 73 |
|
| 74 |
def test_charging_profile_status(): |
| 75 |
assert ChargingProfileStatus.accepted == "Accepted" |
| 76 |
assert ChargingProfileStatus.rejected == "Rejected" |
| 77 |
assert ChargingProfileStatus.not_supported == "NotSupported" |
| 78 |
|
| 79 |
|
| 80 |
def test_charging_rate_unit(): |
| 81 |
assert ChargingRateUnitType.watts == "W" |
| 82 |
assert ChargingRateUnitType.amps == "A" |
| 83 |
|
| 84 |
|
| 85 |
def test_clear_cache_status(): |
| 86 |
assert ClearCacheStatus.accepted == "Accepted" |
| 87 |
assert ClearCacheStatus.rejected == "Rejected" |
| 88 |
|
| 89 |
|
| 90 |
def test_clear_charging_profile_status(): |
| 91 |
assert ClearChargingProfileStatus.accepted == "Accepted" |
| 92 |
assert ClearChargingProfileStatus.unknown == "Unknown" |
| 93 |
|
| 94 |
|
| 95 |
def test_configuration_status(): |
| 96 |
assert ConfigurationStatus.accepted == "Accepted" |
| 97 |
assert ConfigurationStatus.rejected == "Rejected" |
| 98 |
assert ConfigurationStatus.reboot_required == "RebootRequired" |
| 99 |
assert ConfigurationStatus.not_supported == "NotSupported" |
| 100 |
|
| 101 |
|
| 102 |
def test_configuration_keys(): |
| 103 |
assert ( |
| 104 |
ConfigurationKey.allow_offline_tx_for_unknown_id == "AllowOfflineTxForUnknownId" |
| 105 |
) |
| 106 |
assert ConfigurationKey.authorization_cache_enabled == "AuthorizationCacheEnabled" |
| 107 |
assert ConfigurationKey.authorize_remote_tx_requests == "AuthorizeRemoteTxRequests" |
| 108 |
assert ConfigurationKey.blink_repeat == "BlinkRepeat" |
| 109 |
assert ConfigurationKey.clock_aligned_data_interval == "ClockAlignedDataInterval" |
| 110 |
assert ConfigurationKey.connection_time_out == "ConnectionTimeOut" |
| 111 |
assert ConfigurationKey.connector_phase_rotation == "ConnectorPhaseRotation" |
| 112 |
assert ( |
| 113 |
ConfigurationKey.connector_phase_rotation_max_length |
| 114 |
== "ConnectorPhaseRotationMaxLength" |
| 115 |
) |
| 116 |
assert ConfigurationKey.get_configuration_max_keys == "GetConfigurationMaxKeys" |
| 117 |
assert ConfigurationKey.heartbeat_interval == "HeartbeatInterval" |
| 118 |
assert ConfigurationKey.light_intensity == "LightIntensity" |
| 119 |
assert ConfigurationKey.local_authorize_offline == "LocalAuthorizeOffline" |
| 120 |
assert ConfigurationKey.local_pre_authorize == "LocalPreAuthorize" |
| 121 |
assert ConfigurationKey.max_energy_on_invalid_id == "MaxEnergyOnInvalidId" |
| 122 |
assert ConfigurationKey.meter_values_aligned_data == "MeterValuesAlignedData" |
| 123 |
assert ( |
| 124 |
ConfigurationKey.meter_values_aligned_data_max_length |
| 125 |
== "MeterValuesAlignedDataMaxLength" |
| 126 |
) |
| 127 |
assert ConfigurationKey.meter_values_sampled_data == "MeterValuesSampledData" |
| 128 |
assert ( |
| 129 |
ConfigurationKey.meter_values_sampled_data_max_length |
| 130 |
== "MeterValuesSampledDataMaxLength" |
| 131 |
) |
| 132 |
assert ConfigurationKey.meter_value_sample_interval == "MeterValueSampleInterval" |
| 133 |
assert ConfigurationKey.minimum_status_duration == "MinimumStatusDuration" |
| 134 |
assert ConfigurationKey.number_of_connectors == "NumberOfConnectors" |
| 135 |
assert ConfigurationKey.reset_retries == "ResetRetries" |
| 136 |
assert ( |
| 137 |
ConfigurationKey.stop_transaction_on_ev_side_disconnect |
| 138 |
== "StopTransactionOnEVSideDisconnect" |
| 139 |
) |
| 140 |
assert ( |
| 141 |
ConfigurationKey.stop_transaction_on_invalid_id == "StopTransactionOnInvalidId" |
| 142 |
) |
| 143 |
assert ConfigurationKey.stop_txn_aligned_data == "StopTxnAlignedData" |
| 144 |
assert ( |
| 145 |
ConfigurationKey.stop_txn_aligned_data_max_length |
| 146 |
== "StopTxnAlignedDataMaxLength" |
| 147 |
) |
| 148 |
assert ConfigurationKey.stop_txn_sampled_data == "StopTxnSampledData" |
| 149 |
assert ( |
| 150 |
ConfigurationKey.stop_txn_sampled_data_max_length |
| 151 |
== "StopTxnSampledDataMaxLength" |
| 152 |
) |
| 153 |
assert ConfigurationKey.supported_feature_profiles == "SupportedFeatureProfiles" |
| 154 |
assert ( |
| 155 |
ConfigurationKey.supported_feature_profiles_max_length |
| 156 |
== "SupportedFeatureProfilesMaxLength" |
| 157 |
) |
| 158 |
assert ConfigurationKey.transaction_message_attempts == "TransactionMessageAttempts" |
| 159 |
assert ( |
| 160 |
ConfigurationKey.transaction_message_retry_interval |
| 161 |
== "TransactionMessageRetryInterval" |
| 162 |
) |
| 163 |
assert ( |
| 164 |
ConfigurationKey.unlock_connector_on_ev_side_disconnect |
| 165 |
== "UnlockConnectorOnEVSideDisconnect" |
| 166 |
) |
| 167 |
assert ConfigurationKey.web_socket_ping_interval == "WebSocketPingInterval" |
| 168 |
assert ConfigurationKey.local_auth_list_enabled == "LocalAuthListEnabled" |
| 169 |
assert ConfigurationKey.local_auth_list_max_length == "LocalAuthListMaxLength" |
| 170 |
assert ConfigurationKey.send_local_list_max_length == "SendLocalListMaxLength" |
| 171 |
assert ( |
| 172 |
ConfigurationKey.reserve_connector_zero_supported |
| 173 |
== "ReserveConnectorZeroSupported" |
| 174 |
) |
| 175 |
assert ( |
| 176 |
ConfigurationKey.charge_profile_max_stack_level == "ChargeProfileMaxStackLevel" |
| 177 |
) |
| 178 |
assert ( |
| 179 |
ConfigurationKey.charging_schedule_allowed_charging_rate_unit |
| 180 |
== "ChargingScheduleAllowedChargingRateUnit" |
| 181 |
) |
| 182 |
assert ( |
| 183 |
ConfigurationKey.charging_schedule_max_periods == "ChargingScheduleMaxPeriods" |
| 184 |
) |
| 185 |
assert ( |
| 186 |
ConfigurationKey.connector_switch_3to1_phase_supported |
| 187 |
== "ConnectorSwitch3to1PhaseSupported" |
| 188 |
) |
| 189 |
assert ( |
| 190 |
ConfigurationKey.max_charging_profiles_installed |
| 191 |
== "MaxChargingProfilesInstalled" |
| 192 |
) |
| 193 |
assert ( |
| 194 |
ConfigurationKey.central_contract_validation_allowed |
| 195 |
== "CentralContractValidationAllowed" |
| 196 |
) |
| 197 |
assert ( |
| 198 |
ConfigurationKey.certificate_signed_max_chain_size |
| 199 |
== "CertificateSignedMaxChainSize" |
| 200 |
) |
| 201 |
assert ConfigurationKey.cert_signing_wait_minimum == "CertSigningWaitMinimum" |
| 202 |
assert ConfigurationKey.cert_signing_repeat_times == "CertSigningRepeatTimes" |
| 203 |
assert ConfigurationKey.certificate_store_max_length == "CertificateStoreMaxLength" |
| 204 |
assert ConfigurationKey.contract_validation_offline == "ContractValidationOffline" |
| 205 |
assert ConfigurationKey.iso_15118_pnc_enabled == "ISO15118PnCEnabled" |
| 206 |
assert ( |
| 207 |
ConfigurationKey.additional_root_certificate_check |
| 208 |
== "AdditionalRootCertificateCheck" |
| 209 |
) |
| 210 |
assert ConfigurationKey.authorization_key == "AuthorizationKey" |
| 211 |
assert ConfigurationKey.cpo_name == "CpoName" |
| 212 |
assert ConfigurationKey.security_profile == "SecurityProfile" |
| 213 |
|
| 214 |
|
| 215 |
def test_data_transfer_status(): |
| 216 |
assert DataTransferStatus.accepted == "Accepted" |
| 217 |
assert DataTransferStatus.rejected == "Rejected" |
| 218 |
assert DataTransferStatus.unknown_message_id == "UnknownMessageId" |
| 219 |
assert DataTransferStatus.unknown_vendor_id == "UnknownVendorId" |
| 220 |
|
| 221 |
|
| 222 |
def test_diagnostics_status(): |
| 223 |
assert DiagnosticsStatus.idle == "Idle" |
| 224 |
assert DiagnosticsStatus.uploaded == "Uploaded" |
| 225 |
assert DiagnosticsStatus.upload_failed == "UploadFailed" |
| 226 |
assert DiagnosticsStatus.uploading == "Uploading" |
| 227 |
|
| 228 |
|
| 229 |
def test_firmware_status(): |
| 230 |
assert FirmwareStatus.downloaded == "Downloaded" |
| 231 |
assert FirmwareStatus.download_failed == "DownloadFailed" |
| 232 |
assert FirmwareStatus.downloading == "Downloading" |
| 233 |
assert FirmwareStatus.idle == "Idle" |
| 234 |
assert FirmwareStatus.installation_failed == "InstallationFailed" |
| 235 |
assert FirmwareStatus.installing == "Installing" |
| 236 |
assert FirmwareStatus.installed == "Installed" |
| 237 |
|
| 238 |
|
| 239 |
def test_get_composite_schedule_status(): |
| 240 |
assert GetCompositeScheduleStatus.accepted == "Accepted" |
| 241 |
assert GetCompositeScheduleStatus.rejected == "Rejected" |
| 242 |
|
| 243 |
|
| 244 |
def test_location(): |
| 245 |
assert Location.inlet == "Inlet" |
| 246 |
assert Location.outlet == "Outlet" |
| 247 |
assert Location.body == "Body" |
| 248 |
assert Location.cable == "Cable" |
| 249 |
assert Location.ev == "EV" |
| 250 |
|
| 251 |
|
| 252 |
def test_measurand(): |
| 253 |
assert Measurand.energy_active_export_register == "Energy.Active.Export.Register" |
| 254 |
assert Measurand.energy_active_import_register == "Energy.Active.Import.Register" |
| 255 |
assert ( |
| 256 |
Measurand.energy_reactive_export_register == "Energy.Reactive.Export.Register" |
| 257 |
) |
| 258 |
assert ( |
| 259 |
Measurand.energy_reactive_import_register == "Energy.Reactive.Import.Register" |
| 260 |
) |
| 261 |
assert Measurand.energy_active_export_interval == "Energy.Active.Export.Interval" |
| 262 |
assert Measurand.energy_active_import_interval == "Energy.Active.Import.Interval" |
| 263 |
assert ( |
| 264 |
Measurand.energy_reactive_export_interval == "Energy.Reactive.Export.Interval" |
| 265 |
) |
| 266 |
assert ( |
| 267 |
Measurand.energy_reactive_import_interval == "Energy.Reactive.Import.Interval" |
| 268 |
) |
| 269 |
assert Measurand.frequency == "Frequency" |
| 270 |
assert Measurand.power_active_export == "Power.Active.Export" |
| 271 |
assert Measurand.power_active_import == "Power.Active.Import" |
| 272 |
assert Measurand.power_factor == "Power.Factor" |
| 273 |
assert Measurand.power_offered == "Power.Offered" |
| 274 |
assert Measurand.power_reactive_export == "Power.Reactive.Export" |
| 275 |
assert Measurand.power_reactive_import == "Power.Reactive.Import" |
| 276 |
assert Measurand.current_export == "Current.Export" |
| 277 |
assert Measurand.current_import == "Current.Import" |
| 278 |
assert Measurand.current_offered == "Current.Offered" |
| 279 |
assert Measurand.rpm == "RPM" |
| 280 |
assert Measurand.soc == "SoC" |
| 281 |
assert Measurand.voltage == "Voltage" |
| 282 |
assert Measurand.temperature == "Temperature" |
| 283 |
|
| 284 |
|
| 285 |
def test_message_trigger(): |
| 286 |
assert MessageTrigger.boot_notification == "BootNotification" |
| 287 |
assert ( |
| 288 |
MessageTrigger.diagnostics_status_notification |
| 289 |
== "DiagnosticsStatusNotification" |
| 290 |
) |
| 291 |
assert MessageTrigger.firmware_status_notification == "FirmwareStatusNotification" |
| 292 |
assert MessageTrigger.heartbeat == "Heartbeat" |
| 293 |
assert MessageTrigger.meter_values == "MeterValues" |
| 294 |
assert MessageTrigger.status_notification == "StatusNotification" |
| 295 |
|
| 296 |
|
| 297 |
def test_phase(): |
| 298 |
assert Phase.l1 == "L1" |
| 299 |
assert Phase.l2 == "L2" |
| 300 |
assert Phase.l3 == "L3" |
| 301 |
assert Phase.n == "N" |
| 302 |
assert Phase.l1_n == "L1-N" |
| 303 |
assert Phase.l2_n == "L2-N" |
| 304 |
assert Phase.l3_n == "L3-N" |
| 305 |
assert Phase.l1_l2 == "L1-L2" |
| 306 |
assert Phase.l2_l3 == "L2-L3" |
| 307 |
assert Phase.l3_l1 == "L3-L1" |
| 308 |
|
| 309 |
|
| 310 |
def test_reading_context(): |
| 311 |
assert ReadingContext.interruption_begin == "Interruption.Begin" |
| 312 |
assert ReadingContext.interruption_end == "Interruption.End" |
| 313 |
assert ReadingContext.other == "Other" |
| 314 |
assert ReadingContext.sample_clock == "Sample.Clock" |
| 315 |
assert ReadingContext.sample_periodic == "Sample.Periodic" |
| 316 |
assert ReadingContext.transaction_begin == "Transaction.Begin" |
| 317 |
assert ReadingContext.transaction_end == "Transaction.End" |
| 318 |
assert ReadingContext.trigger == "Trigger" |
| 319 |
|
| 320 |
|
| 321 |
def test_reason(): |
| 322 |
assert Reason.emergency_stop == "EmergencyStop" |
| 323 |
assert Reason.ev_disconnected == "EVDisconnected" |
| 324 |
assert Reason.hard_reset == "HardReset" |
| 325 |
assert Reason.local == "Local" |
| 326 |
assert Reason.other == "Other" |
| 327 |
assert Reason.power_loss == "PowerLoss" |
| 328 |
assert Reason.reboot == "Reboot" |
| 329 |
assert Reason.remote == "Remote" |
| 330 |
assert Reason.soft_reset == "SoftReset" |
| 331 |
assert Reason.unlock_command == "UnlockCommand" |
| 332 |
assert Reason.de_authorized == "DeAuthorized" |
| 333 |
|
| 334 |
|
| 335 |
def test_recurrency_kind(): |
| 336 |
assert RecurrencyKind.daily == "Daily" |
| 337 |
assert RecurrencyKind.weekly == "Weekly" |
| 338 |
|
| 339 |
|
| 340 |
def test_registration_status(): |
| 341 |
assert RegistrationStatus.accepted == "Accepted" |
| 342 |
assert RegistrationStatus.pending == "Pending" |
| 343 |
assert RegistrationStatus.rejected == "Rejected" |
| 344 |
|
| 345 |
|
| 346 |
def test_remote_start_stop_status(): |
| 347 |
assert RemoteStartStopStatus.accepted == "Accepted" |
| 348 |
assert RemoteStartStopStatus.rejected == "Rejected" |
| 349 |
|
| 350 |
|
| 351 |
def test_reservation_status(): |
| 352 |
assert ReservationStatus.accepted == "Accepted" |
| 353 |
assert ReservationStatus.faulted == "Faulted" |
| 354 |
assert ReservationStatus.occupied == "Occupied" |
| 355 |
assert ReservationStatus.rejected == "Rejected" |
| 356 |
assert ReservationStatus.unavailable == "Unavailable" |
| 357 |
|
| 358 |
|
| 359 |
def test_reset_status(): |
| 360 |
assert ResetStatus.accepted == "Accepted" |
| 361 |
assert ResetStatus.rejected == "Rejected" |
| 362 |
|
| 363 |
|
| 364 |
def test_reset_type(): |
| 365 |
assert ResetType.hard == "Hard" |
| 366 |
assert ResetType.soft == "Soft" |
| 367 |
|
| 368 |
|
| 369 |
def test_trigger_message_status(): |
| 370 |
assert TriggerMessageStatus.accepted == "Accepted" |
| 371 |
assert TriggerMessageStatus.rejected == "Rejected" |
| 372 |
assert TriggerMessageStatus.not_implemented == "NotImplemented" |
| 373 |
|
| 374 |
|
| 375 |
def test_unit_of_measure(): |
| 376 |
assert UnitOfMeasure.wh == "Wh" |
| 377 |
assert UnitOfMeasure.kwh == "kWh" |
| 378 |
assert UnitOfMeasure.varh == "varh" |
| 379 |
assert UnitOfMeasure.kvarh == "kvarh" |
| 380 |
assert UnitOfMeasure.w == "W" |
| 381 |
assert UnitOfMeasure.kw == "kW" |
| 382 |
assert UnitOfMeasure.va == "VA" |
| 383 |
assert UnitOfMeasure.kva == "kVA" |
| 384 |
assert UnitOfMeasure.var == "var" |
| 385 |
assert UnitOfMeasure.kvar == "kvar" |
| 386 |
assert UnitOfMeasure.a == "A" |
| 387 |
assert UnitOfMeasure.v == "V" |
| 388 |
assert UnitOfMeasure.celsius == "Celsius" |
| 389 |
assert UnitOfMeasure.fahrenheit == "Fahrenheit" |
| 390 |
assert UnitOfMeasure.k == "K" |
| 391 |
assert UnitOfMeasure.percent == "Percent" |
| 392 |
|
| 393 |
|
| 394 |
def test_unlock_status(): |
| 395 |
assert UnlockStatus.unlocked == "Unlocked" |
| 396 |
assert UnlockStatus.unlock_failed == "UnlockFailed" |
| 397 |
assert UnlockStatus.not_supported == "NotSupported" |
| 398 |
|
| 399 |
|
| 400 |
def test_update_status(): |
| 401 |
assert UpdateStatus.accepted == "Accepted" |
| 402 |
assert UpdateStatus.failed == "Failed" |
| 403 |
assert UpdateStatus.not_supported == "NotSupported" |
| 404 |
assert UpdateStatus.version_mismatch == "VersionMismatch" |
| 405 |
|
| 406 |
|
| 407 |
def test_update_type(): |
| 408 |
assert UpdateType.differential == "Differential" |
| 409 |
assert UpdateType.full == "Full" |
| 410 |
|
| 411 |
|
| 412 |
def test_value_format(): |
| 413 |
assert ValueFormat.raw == "Raw" |
| 414 |
assert ValueFormat.signed_data == "SignedData" |