Ejemplo n.º 1
0
    def test_procedure_partial_returned_arguments_with_keywords(self):

        idl_test_procedure = idl.export_procedure("idl_test_procedure",
                                                  return_arguments=[0, 2])
        a, c = idl_test_procedure(1.5, 2.5, 3.5, 4.5, key_a=True)
        self.assertEqual(a, 40, "Argument a was not correctly returned.")
        self.assertEqual(c, 80, "Argument c was not correctly returned.")
Ejemplo n.º 2
0
    def test_procedure_full_returned_arguments_with_keywords(self):

        idl_test_procedure = idl.export_procedure("idl_test_procedure", return_arguments=[0, 1, 2, 3])
        a, b, c, d = idl_test_procedure(1.5, 2.5, 3.5, 4.5, key_b=True)
        self.assertEqual(a, 2000, "Argument a was not correctly returned.")
        self.assertEqual(b, 3000, "Argument b was not correctly returned.")
        self.assertEqual(c, 4000, "Argument c was not correctly returned.")
        self.assertEqual(d, 0.0, "Argument d was not correctly returned.")
Ejemplo n.º 3
0
    def test_procedure_full_returned_arguments_with_keywords(self):

        idl_test_procedure = idl.export_procedure(
            "idl_test_procedure", return_arguments=[0, 1, 2, 3])
        a, b, c, d = idl_test_procedure(1.5, 2.5, 3.5, 4.5, key_b=True)
        self.assertEqual(a, 2000, "Argument a was not correctly returned.")
        self.assertEqual(b, 3000, "Argument b was not correctly returned.")
        self.assertEqual(c, 4000, "Argument c was not correctly returned.")
        self.assertEqual(d, 0.0, "Argument d was not correctly returned.")
Ejemplo n.º 4
0
    def test_procedure_basic_call(self):

        idl_test_procedure = idl.export_procedure("idl_test_procedure")
        self.assertEqual(None, idl_test_procedure(1, 2, 3, 4),
                         "Calling procedure with basic arguments failed.")
        self.assertEqual(
            None, idl_test_procedure(1, 2, 3, 4, key_a=True),
            "Calling procedure with keyword argument failed (1 of 2).")
        self.assertEqual(
            None, idl_test_procedure(1, 2, 3, 4, key_b=True),
            "Calling procedure with keyword argument failed (2 of 2).")
Ejemplo n.º 5
0
    def test_procedure_partial_returned_arguments_with_keywords(self):

        idl_test_procedure = idl.export_procedure("idl_test_procedure", return_arguments=[0, 2])
        a, c = idl_test_procedure(1.5, 2.5, 3.5, 4.5, key_a=True)
        self.assertEqual(a, 40, "Argument a was not correctly returned.")
        self.assertEqual(c, 80, "Argument c was not correctly returned.")
Ejemplo n.º 6
0
    def test_procedure_basic_call(self):

        idl_test_procedure = idl.export_procedure("idl_test_procedure")
        self.assertEqual(None, idl_test_procedure(1, 2, 3, 4), "Calling procedure with basic arguments failed.")
        self.assertEqual(None, idl_test_procedure(1, 2, 3, 4, key_a=True), "Calling procedure with keyword argument failed (1 of 2).")
        self.assertEqual(None, idl_test_procedure(1, 2, 3, 4, key_b=True), "Calling procedure with keyword argument failed (2 of 2).")