def test__get_code(mocker):
    """
    Test "_get_code" method must return plugin exit code.
    """

    mocker.patch("sys.argv",
                 ["check_hddtemp.py", "-s", "127.0.0.1", "-p", "7634"])
    checker = CheckHDDTemp()
    result = checker._get_code(status="ok")

    assert result == 0  # nosec: B101
def test__get_code__unknown_device_temperature(mocker):
    """
    Test "_get_code" method must return plugin exit code
    (unknown device temperature case).
    """

    mocker.patch("sys.argv",
                 ["check_hddtemp.py", "-s", "127.0.0.1", "-p", "7634"])
    checker = CheckHDDTemp()
    result = checker._get_code(status="unknown")

    assert result == 3  # nosec: B101