Пример #1
0
    def run_tests(self, ret_value, result, mock_getdefaultlocale):
        """Run the main test.

        Args:
            ret_value (tuple): Return tuple of the locale.getdefaultlocale module
            result (unicode): Result we want to see
            mock_getdefaultlocale (MagicMock): Mock object
        """
        mock_getdefaultlocale.return_value = ret_value
        lang = utils.get_default_lang()

        mock_getdefaultlocale.assert_called_once()
        self.assertEqual(lang, result)
Пример #2
0
    def run_tests(self, ret_value, result, mock_getdefaultlocale):
        """Run the main test.

        Args:
            ret_value (tuple): Return tuple of the locale.getdefaultlocale module
            result (unicode): Result we want to see
            mock_getdefaultlocale (MagicMock): Mock object
        """
        mock_getdefaultlocale.return_value = ret_value
        lang = utils.get_default_lang()

        mock_getdefaultlocale.assert_called_once()
        self.assertEqual(lang, result)