Пример #1
0
    def test_assert_is_float_none(self):
        """Checks assert_is_float when input is None."""

        with self.assertRaises(TypeError):
            error_checking.assert_is_float(None)
Пример #2
0
    def test_assert_is_float_integer(self):
        """Checks assert_is_float when input is integer."""

        with self.assertRaises(TypeError):
            error_checking.assert_is_float(SINGLE_INTEGER)
Пример #3
0
    def test_assert_is_float_nan(self):
        """Checks assert_is_float when input is NaN."""

        error_checking.assert_is_float(numpy.nan)
Пример #4
0
    def test_assert_is_float_complex(self):
        """Checks assert_is_float when input is complex."""

        with self.assertRaises(TypeError):
            error_checking.assert_is_float(SINGLE_COMPLEX_NUMBER)
Пример #5
0
    def test_assert_is_float_boolean(self):
        """Checks assert_is_float when input is Boolean."""

        with self.assertRaises(TypeError):
            error_checking.assert_is_float(SINGLE_BOOLEAN)
Пример #6
0
    def test_assert_is_float_true(self):
        """Checks assert_is_float when input is float."""

        error_checking.assert_is_float(SINGLE_FLOAT)
Пример #7
0
    def test_assert_is_float_too_many_inputs(self):
        """Checks assert_is_float when input is array of floats."""

        with self.assertRaises(TypeError):
            error_checking.assert_is_float(FLOAT_NUMPY_ARRAY)