Esempio n. 1
0
    def test_prepare_kwargs_with_data_only_and_func_params_match(self):
        """A function is passed, its params *do* match."""

        def ath(a):
            pass

        self.assertEqual(dict(a=1), tasks._prepare_kwargs("a", 1, None, ath))
Esempio n. 2
0
    def test_prepare_kwargs_with_full_func_params_match(self):
        """
        Other args and a function is passed, the latter's params all match.
        """

        def ath(a, c, d):
            pass

        self.assertEqual(dict(a=1, c=3, d=4),
                         tasks._prepare_kwargs("a", 1, dict(c=3, d=4), ath))
Esempio n. 3
0
    def test_prepare_kwargs_with_func_params_mismatch(self):
        """
        Other args and a function is passed, the latter's params do not match.
        """

        def ath(x):
            pass

        self.assertEqual(dict(),
                         tasks._prepare_kwargs("a", 1, dict(c=3, d=4), ath))
Esempio n. 4
0
 def test_prepare_kwargs_with_other_data(self):
     """Pass `other_args` that is not `None`."""
     self.assertEqual(dict(a=1, c=3, d=4),
                      tasks._prepare_kwargs("a", 1, dict(c=3, d=4)))
Esempio n. 5
0
 def test_prepare_kwargs_with_data_only(self):
     """Simplest case: no other args and no function passed"""
     self.assertEqual(dict(a=1), tasks._prepare_kwargs("a", 1, None))