File: test_response.py

package info (click to toggle)
python-rabbitair 0.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 216 kB
  • sloc: python: 1,038; makefile: 13; sh: 5
file content (20 lines) | stat: -rw-r--r-- 576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Test response parsing."""

import pytest

from rabbitair import Model, Quality, State


def test_state_invalid_value() -> None:
    """Test invalid value in state response."""
    state = State({"mode": 10})
    assert repr(state)
    with pytest.raises(ValueError):
        assert state.mode is not None


def test_state_biogs_case() -> None:
    """This case is only defined in the protocol specification, but will never occur in real life."""
    state = State({"model": 2, "quality": 1})
    assert state.model is Model.BioGS
    assert state.quality is Quality.Lowest