Ejemplo n.º 1
0
    def test_accepts_matrix_abcd(self):
        """
        Tests if accepts (A, B, C, D) matrices.
        """

        A, B, C, D = self.__build_matrix_abcd()
        dsf(A=A, B=B, C=C, D=D)
Ejemplo n.º 2
0
    def test_accepts_abcd(self):
        """
        Tests if accepts (A, B, C, D) nested lists.
        """

        A, B, C, D = self.__build_standard_abcd()
        dsf(A=A, B=B, C=C, D=D)
Ejemplo n.º 3
0
    def test_accept_sys(self):
        """
        Tests if passing a StateSpace as ``sys`` raises no errors.
        """

        [A, B, C, D] = self.__build_standard_abcd()
        sys = ss(A, B, C, D)
        dsf(sys=sys)
Ejemplo n.º 4
0
    def test_sys_typecheck(self):
        """
        Tests if passing an invalid type as ``sys`` raises a TypeError.
        """

        with pytest.raises(TypeError):
            bad_sys = 12
            dsf(sys=bad_sys)

        with pytest.raises(TypeError):
            bad_sys = True
            dsf(sys=bad_sys)
Ejemplo n.º 5
0
    def test_require_a(self):
        """
        Tests if at least A is required.
        """
        A, B, C, D = self.__build_standard_abcd()

        with pytest.raises(ValueError):
            dsf(C=C)
        with pytest.raises(ValueError):
            dsf(B=B)
        with pytest.raises(ValueError):
            dsf(B=B, C=C)