Example #1
0
    def test_build_parameters(self):
        """Test if a list of parameters is build"""

        expected = {'a': 1, 'b': 2, 'c': 3}
        params = {'a': 1, 'b': 2, 'c': 3}
        found = build_signature_parameters(params, MockCallable.test)
        self.assertDictEqual(found, expected)

        expected = {'a': 1, 'b': 2}
        params = {'a': 1, 'b': 2, 'd': 3}
        found = build_signature_parameters(params, MockCallable.test)
        self.assertDictEqual(found, expected)
Example #2
0
    def test_attribute_error(self):
        """Test if it raises an exception for not found arguments"""

        with self.assertRaises(AttributeError) as e:
            params = {'a': 1, 'd': 3}
            _ = build_signature_parameters(params, MockCallable.test)
            self.assertEqual(e.exception.args[1], 'b')