Source code for iodata.test.test_utils

# IODATA is an input and output module for quantum chemistry.
# Copyright (C) 2011-2019 The IODATA Development Team
#
# This file is part of IODATA.
#
# IODATA is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# IODATA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
# --
"""Unit tests for iodata.utils."""

import pytest

from ..utils import amu, strtobool


[docs] def test_amu(): assert abs(amu * 1.008 - 1837.47) < 1e-1
[docs] def test_strtobool(): assert strtobool("T") is True assert strtobool("false") is False assert strtobool("y") is True with pytest.raises(ValueError): strtobool("whatever")