示例#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)