def test_unit_no_iter():
    unit_no = UnitNo("6628-123")
    assert [x for x in unit_no] == [6628, 123]
def test_accept_empty_unit_no():
    UnitNo()
def test_unit_no_long_int():
    unit_no = UnitNo("6628-123")
    assert unit_no.long_int == 662800123
def test_empty_unit_no(attr_name, expected_value):
    assert (getattr(UnitNo(), attr_name) == expected_value
            )  # against PEP8 for None but should work
def test_unit_no_parsing(test_input, expected):
    assert UnitNo(test_input) == expected
def test_dodgy_unit_no_1():
    with pytest.raises(ValueError):
        UnitNo(615)
def test_dodgy_unit_no():
    with pytest.raises(ValueError):
        UnitNo("yat", 124)
def test_unit_no_hash():
    unit_no = UnitNo("6628-1527")
    assert {unit_no: "value"}[unit_no] == "value"