marcolivierarsenault / moonraker-home-assistant

Home Assistant integration for Moonraker, Klipper and Mainsail
https://moonraker-home-assistant.readthedocs.io
MIT License
231 stars 25 forks source link

tests fail #184

Closed busheezy closed 1 year ago

busheezy commented 1 year ago

Version

Latest main branch

setup

vscode devcontainer

Describe the bug

It seems a large number of tests are currently failing. I went to implement some tests but wanted to make sure the current ones worked before I touched them.

Logs

==================================================================================== short test summary info =====================================================================================
FAILED tests/test_binary_sensor.py::test_runout_filament_sensor - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_binary_sensor.py::test_multiple_runout_filament_sensor - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_binary_sensor.py::test_runout_filament_sensor_off - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_button.py::test_buttons[mainsail_emergency_stop-printer.emergency_stop] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_firmware_restart-printer.firmware_restart] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_host_restart-machine.reboot] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_host_shutdown-machine.shutdown] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_pause_print-printer.print.pause] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_resume_print-printer.print.resume] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_server_restart-server.restart] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_buttons[mainsail_cancel_print-printer.print.cancel] - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_gcode_macro - AssertionError: Expected 'call_method' to be called once. Called 0 times.
FAILED tests/test_button.py::test_disabled_buttons - assert None
FAILED tests/test_camera.py::test_camera_services - assert None is not None
FAILED tests/test_camera.py::test_camera_services_full_path - assert None is not None
FAILED tests/test_camera.py::test_two_cameras_services - AssertionError: assert None is not None
FAILED tests/test_camera.py::test_two_cameras_same_name_services - AssertionError: assert None is not None
FAILED tests/test_camera.py::test_setup_thumbnail_camera - assert None is not None
FAILED tests/test_camera.py::test_thumbnail_camera_image - homeassistant.exceptions.HomeAssistantError: Camera not found
FAILED tests/test_camera.py::test_thumbnail_no_thumbnail - assert None is not None
FAILED tests/test_camera.py::test_thumbnail_no_thumbnail_after_update - homeassistant.exceptions.HomeAssistantError: Camera not found
FAILED tests/test_camera.py::test_thumbnail_data_failing - assert None is not None
FAILED tests/test_camera.py::test_thumbnail_on_subfolder - homeassistant.exceptions.HomeAssistantError: Camera not found
FAILED tests/test_config_flow.py::test_successful_config_flow - AssertionError: assert {'api_key': '...l': '1.2.3.4'} == {'api_key': '...l': '1.2.3.4'}
FAILED tests/test_config_flow.py::test_server_port_when_good_port - AssertionError: assert {'api_key': '...l': '1.2.3.4'} == {'api_key': '...l': '1.2.3.4'}
FAILED tests/test_config_flow.py::test_server_port_when_port_empty - AssertionError: assert {'api_key': '...l': '1.2.3.4'} == {'api_key': '...l': '1.2.3.4'}
FAILED tests/test_config_flow.py::test_server_api_key_when_good - AssertionError: assert {'api_key': '...l': '1.2.3.4'} == {'api_key': '...l': '1.2.3.4'}
FAILED tests/test_config_flow.py::test_server_api_key_when_empty - AssertionError: assert {'api_key': '...l': '1.2.3.4'} == {'api_key': '...l': '1.2.3.4'}
FAILED tests/test_number.py::test_number_set_value[mainsail_output_pin_pwm] - AssertionError: call_method('printer.gcode.script', script='SET_PIN PIN=pwm VALUE=0.5') call not found
FAILED tests/test_sensor.py::test_sensor_services_update - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_mcu_temp-32.43] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_bed_target-60.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_bed_temperature-60.01] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_extruder_target-205.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_extruder_temperature-205.02] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_progress-900] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_printer_state-ready] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_filename-CE3E3V2_picture_frame_holder.gcode] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_current_display_message-Custom Message] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_printer_message-Printer is ready] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_current_print_state-printing] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_current_print_message-] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_print_projected_total_duration-9197.46] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_print_time_left-1182.94] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_print_duration-133.58] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_filament_used-5.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_progress-901] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_bed_power-26] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_extruder_power-66] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_fan_speed-51.23] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_fan_temp-32.43] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_bme280_temp-32.43] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_htu21d_temp-32.43] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_lm75_temp-32.43] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_heater_fan-51.23] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_controller_fan-51.23] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_nevermore_fan-12.34] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_totals_print_time-3h 9m 9s] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_totals_jobs-3] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_totals_filament_used-11.62] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_longest_print-3h 9m 9s] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_total_layer-313] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_current_layer-51] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_toolhead_position_x-23.3] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_toolhead_position_y-22.2] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_toolhead_position_z-10.2] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors[mainsail_slicer_print_duration_estimate-8232.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_filename-] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_current_print_state-standby] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_filament_used-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_print_duration-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_print_time_left-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_print_projected_total_duration-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_progress-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_total_layer-0.0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_sensors_not_printing[mainsail_current_layer-0] - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_eta - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_slicer_time_left - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_eta_no_current_data - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_sensor.py::test_rounding_fan - AttributeError: 'NoneType' object has no attribute 'state'
FAILED tests/test_switch.py::test_switch_turn_on[mainsail_light-power] - AssertionError: call_method('machine.device_power.post_device', device='light', action='on') call not found
FAILED tests/test_switch.py::test_switch_turn_on[mainsail_printer-power] - AssertionError: call_method('machine.device_power.post_device', device='printer', action='on') call not found
FAILED tests/test_switch.py::test_switch_turn_on[mainsail_output_pin_digital-pin] - AssertionError: call_method('printer.gcode.script', script='SET_PIN PIN=digital VALUE=1') call not found
FAILED tests/test_switch.py::test_switch_turn_off[mainsail_light-power] - AssertionError: call_method('machine.device_power.post_device', device='light', action='off') call not found
FAILED tests/test_switch.py::test_switch_turn_off[mainsail_printer-power] - AssertionError: call_method('machine.device_power.post_device', device='printer', action='off') call not found
FAILED tests/test_switch.py::test_switch_turn_off[mainsail_output_pin_digital-pin] - AssertionError: call_method('printer.gcode.script', script='SET_PIN PIN=digital VALUE=0') call not found

Results (14.12s):
      26 passed
      86 failed
         - tests/test_binary_sensor.py:40 test_runout_filament_sensor
         - tests/test_binary_sensor.py:49 test_multiple_runout_filament_sensor
         - tests/test_binary_sensor.py:61 test_runout_filament_sensor_off
         - tests/test_button.py:23 test_buttons[mainsail_emergency_stop-printer.emergency_stop]
         - tests/test_button.py:23 test_buttons[mainsail_firmware_restart-printer.firmware_restart]
         - tests/test_button.py:23 test_buttons[mainsail_host_restart-machine.reboot]
         - tests/test_button.py:23 test_buttons[mainsail_host_shutdown-machine.shutdown]
         - tests/test_button.py:23 test_buttons[mainsail_pause_print-printer.print.pause]
         - tests/test_button.py:23 test_buttons[mainsail_resume_print-printer.print.resume]
         - tests/test_button.py:23 test_buttons[mainsail_server_restart-server.restart]
         - tests/test_button.py:23 test_buttons[mainsail_cancel_print-printer.print.cancel]
         - tests/test_button.py:55 test_gcode_macro
         - tests/test_button.py:76 test_disabled_buttons
         - tests/test_camera.py:27 test_camera_services
         - tests/test_camera.py:41 test_camera_services_full_path
         - tests/test_camera.py:60 test_two_cameras_services
         - tests/test_camera.py:79 test_two_cameras_same_name_services
         - tests/test_camera.py:98 test_setup_thumbnail_camera
         - tests/test_camera.py:112 test_thumbnail_camera_image
         - tests/test_camera.py:144 test_thumbnail_no_thumbnail
         - tests/test_camera.py:176 test_thumbnail_no_thumbnail_after_update
         - tests/test_camera.py:209 test_thumbnail_data_failing
         - tests/test_camera.py:230 test_thumbnail_on_subfolder
         - tests/test_config_flow.py:11 test_successful_config_flow
         - tests/test_config_flow.py:93 test_server_port_when_good_port
         - tests/test_config_flow.py:109 test_server_port_when_port_empty
         - tests/test_config_flow.py:161 test_server_api_key_when_good
         - tests/test_config_flow.py:185 test_server_api_key_when_empty
         - tests/test_number.py:23 test_number_set_value[mainsail_output_pin_pwm]
         - tests/test_sensor.py:42 test_sensor_services_update
         - tests/test_sensor.py:66 test_sensors[mainsail_mcu_temp-32.43]
         - tests/test_sensor.py:66 test_sensors[mainsail_bed_target-60.0]
         - tests/test_sensor.py:66 test_sensors[mainsail_bed_temperature-60.01]
         - tests/test_sensor.py:66 test_sensors[mainsail_extruder_target-205.0]
         - tests/test_sensor.py:66 test_sensors[mainsail_extruder_temperature-205.02]
         - tests/test_sensor.py:66 test_sensors[mainsail_progress-900]
         - tests/test_sensor.py:66 test_sensors[mainsail_printer_state-ready]
         - tests/test_sensor.py:66 test_sensors[mainsail_filename-CE3E3V2_picture_frame_holder.gcode]
         - tests/test_sensor.py:66 test_sensors[mainsail_current_display_message-Custom Message]
         - tests/test_sensor.py:66 test_sensors[mainsail_printer_message-Printer is ready]
         - tests/test_sensor.py:66 test_sensors[mainsail_current_print_state-printing]
         - tests/test_sensor.py:66 test_sensors[mainsail_current_print_message-]
         - tests/test_sensor.py:66 test_sensors[mainsail_print_projected_total_duration-9197.46]
         - tests/test_sensor.py:66 test_sensors[mainsail_print_time_left-1182.94]
         - tests/test_sensor.py:66 test_sensors[mainsail_print_duration-133.58]
         - tests/test_sensor.py:66 test_sensors[mainsail_filament_used-5.0]
         - tests/test_sensor.py:66 test_sensors[mainsail_progress-901]
         - tests/test_sensor.py:66 test_sensors[mainsail_bed_power-26]
         - tests/test_sensor.py:66 test_sensors[mainsail_extruder_power-66]
         - tests/test_sensor.py:66 test_sensors[mainsail_fan_speed-51.23]
         - tests/test_sensor.py:66 test_sensors[mainsail_fan_temp-32.43]
         - tests/test_sensor.py:66 test_sensors[mainsail_bme280_temp-32.43]
         - tests/test_sensor.py:66 test_sensors[mainsail_htu21d_temp-32.43]
         - tests/test_sensor.py:66 test_sensors[mainsail_lm75_temp-32.43]
         - tests/test_sensor.py:66 test_sensors[mainsail_heater_fan-51.23]
         - tests/test_sensor.py:66 test_sensors[mainsail_controller_fan-51.23]
         - tests/test_sensor.py:66 test_sensors[mainsail_nevermore_fan-12.34]
         - tests/test_sensor.py:66 test_sensors[mainsail_totals_print_time-3h 9m 9s]
         - tests/test_sensor.py:66 test_sensors[mainsail_totals_jobs-3]
         - tests/test_sensor.py:66 test_sensors[mainsail_totals_filament_used-11.62]
         - tests/test_sensor.py:66 test_sensors[mainsail_longest_print-3h 9m 9s]
         - tests/test_sensor.py:66 test_sensors[mainsail_total_layer-313]
         - tests/test_sensor.py:66 test_sensors[mainsail_current_layer-51]
         - tests/test_sensor.py:66 test_sensors[mainsail_toolhead_position_x-23.3]
         - tests/test_sensor.py:66 test_sensors[mainsail_toolhead_position_y-22.2]
         - tests/test_sensor.py:66 test_sensors[mainsail_toolhead_position_z-10.2]
         - tests/test_sensor.py:66 test_sensors[mainsail_slicer_print_duration_estimate-8232.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_filename-]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_current_print_state-standby]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_filament_used-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_print_duration-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_print_time_left-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_print_projected_total_duration-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_progress-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_total_layer-0.0]
         - tests/test_sensor.py:121 test_sensors_not_printing[mainsail_current_layer-0]
         - tests/test_sensor.py:161 test_eta
         - tests/test_sensor.py:176 test_slicer_time_left
         - tests/test_sensor.py:193 test_eta_no_current_data
         - tests/test_sensor.py:283 test_rounding_fan
         - tests/test_switch.py:27 test_switch_turn_on[mainsail_light-power]
         - tests/test_switch.py:27 test_switch_turn_on[mainsail_printer-power]
         - tests/test_switch.py:27 test_switch_turn_on[mainsail_output_pin_digital-pin]
         - tests/test_switch.py:67 test_switch_turn_off[mainsail_light-power]
         - tests/test_switch.py:67 test_switch_turn_off[mainsail_printer-power]
         - tests/test_switch.py:67 test_switch_turn_off[mainsail_output_pin_digital-pin]
marcolivierarsenault commented 1 year ago

can you run home assistant using vscode tasks?

busheezy commented 1 year ago

Yeah, I've been developing with your tasks in the devcontainer. It runs fine with "Run Home Assistant on port 8123" but "Run tests" fails.

busheezy commented 1 year ago

Solved. A mistake on my end.