How to use the ddt.idata function in ddt

To help you get started, we’ve selected a few ddt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github k4cg / nichtparasoup / tests / test_10_nichtparasoup / test_imagecrawler / test_pr0gramm.py View on Github external
    @ddt_idata((i, str(i)) for i in range(1, 16, 1))  # type: ignore
    @ddt_unpack  # type: ignore
    def test_flags(self, flags: int, flags_qs: str) -> None:
        # act
        api_uri = Pr0gramm._get_api_uri(flags=flags, promoted=False)
        (_, _, _, query_string, _) = urlsplit(api_uri)
        query = parse_qs(query_string)
        # assert
        self.assertEqual([flags_qs], query['flags'])
github k4cg / nichtparasoup / tests / test_10_nichtparasoup / test_cli / test_commands.py View on Github external
    @ddt_idata(_COMMANDS.keys())  # type: ignore
    def test_create_command(self, command_name: str) -> None:
        command = create_command(command_name)
        self.assertIsInstance(command, BaseCommand, command_name)