Exemplo n.º 1
0
    def test_partial_mixed_args(self):
        args = (3,)
        kwargs = {"instance": {"uuid": 1}}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        self.assertEqual(4, len(callargs))
        self.assertTrue("instance" in callargs)
        self.assertEqual({"uuid": 1}, callargs["instance"])
        self.assertTrue("red" in callargs)
        self.assertEqual(3, callargs["red"])
        self.assertTrue("blue" in callargs)
        self.assertEqual(None, callargs["blue"])
Exemplo n.º 2
0
    def test_partial_mixed_args(self):
        args = (3,)
        kwargs = {'instance': {'uuid': 1}}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertIsNone(callargs['blue'])
Exemplo n.º 3
0
    def test_partial_mixed_args(self):
        args = (3,)
        kwargs = {'instance': {'uuid': 1}}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertEqual(None, callargs['blue'])
Exemplo n.º 4
0
    def test_partial_args(self):
        args = ({'uuid': 1}, 3)
        kwargs = {}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        #implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertIsNone(callargs['blue'])
Exemplo n.º 5
0
    def test_all_kwargs(self):
        args = ()
        kwargs = {'instance': {'uuid': 1}, 'red': 3, 'blue': 4}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        #implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertEqual(4, callargs['blue'])
Exemplo n.º 6
0
    def test_partial_args(self):
        args = ({"uuid": 1}, 3)
        kwargs = {}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        # implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue("instance" in callargs)
        self.assertEqual({"uuid": 1}, callargs["instance"])
        self.assertTrue("red" in callargs)
        self.assertEqual(3, callargs["red"])
        self.assertTrue("blue" in callargs)
        self.assertEqual(None, callargs["blue"])
Exemplo n.º 7
0
    def test_all_kwargs(self):
        args = ()
        kwargs = {"instance": {"uuid": 1}, "red": 3, "blue": 4}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        # implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue("instance" in callargs)
        self.assertEqual({"uuid": 1}, callargs["instance"])
        self.assertTrue("red" in callargs)
        self.assertEqual(3, callargs["red"])
        self.assertTrue("blue" in callargs)
        self.assertEqual(4, callargs["blue"])
Exemplo n.º 8
0
    def test_partial_args(self):
        args = ({'uuid': 1}, 3)
        kwargs = {}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        #implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertEqual(None, callargs['blue'])
Exemplo n.º 9
0
    def test_all_kwargs(self):
        args = ()
        kwargs = {'instance': {'uuid': 1}, 'red': 3, 'blue': 4}
        callargs = funcutils.getcallargs(self._test_func, *args, **kwargs)

        #implicit self counts as an arg
        self.assertEqual(4, len(callargs))
        self.assertTrue('instance' in callargs)
        self.assertEqual({'uuid': 1}, callargs['instance'])
        self.assertTrue('red' in callargs)
        self.assertEqual(3, callargs['red'])
        self.assertTrue('blue' in callargs)
        self.assertEqual(4, callargs['blue'])