File: test_printer.py

package info (click to toggle)
pyoctoprintapi 0.1.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: python: 750; makefile: 6; sh: 5
file content (21 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Test job information API."""
import json

from pyoctoprintapi.printer import OctoprintPrinterInfo
from fixtures import TEST_PRINTER

def test_properties():
    printer = OctoprintPrinterInfo(json.loads(TEST_PRINTER))
    assert printer.state.flags.ready
    assert not printer.state.flags.printing
    assert not printer.state.flags.error
    assert printer.state.text == "Operational"
    assert printer.has_heated_bed
    assert printer.temperatures[0].name == "bed"
    assert printer.temperatures[0].actual_temp == 14.53
    assert printer.temperatures[0].offset == -5
    assert printer.temperatures[0].target_temp == 60
    assert printer.temperatures[1].name == "tool0"
    assert printer.temperatures[1].actual_temp == 14.17
    assert printer.temperatures[1].offset == 10
    assert printer.temperatures[1].target_temp == 200