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

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

        error_checking.assert_is_float(SINGLE_FLOAT)
Ejemplo n.º 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)