Beispiel #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)
Beispiel #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)
Beispiel #3
0
    def test_assert_is_float_nan(self):
        """Checks assert_is_float when input is NaN."""

        error_checking.assert_is_float(numpy.nan)
Beispiel #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)
Beispiel #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)
Beispiel #6
0
    def test_assert_is_float_true(self):
        """Checks assert_is_float when input is float."""

        error_checking.assert_is_float(SINGLE_FLOAT)
Beispiel #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)