How to use the ddt.file_data 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 WSDOT / fb-comment-downloader / src / test_validation.py View on Github external
    @file_data('test_data_urls.json')
    def test_post_id_match(self, test_url):

        post_id = get_post_id_from_fb_url(test_url)

        self.assertEqual(
                post_id,
                expected_post_id,
                'post_id {0} did not match expected id {1} '.format(post_id, expected_post_id))
github jmcfarlane / notable / test / test_crypt.py View on Github external
    @file_data('sample-passwords.json')
    def test_content_containing_special_chars_with_password_that_is(self, pwd):
        self._encrypt("""!@#$%^&*()_+_+[]\{}|;':",./<>?""", pwd)
github datadriventests / ddt / test / test_example.py View on Github external
    @file_data('test_data_list.yaml')
    def test_file_data_yaml_list(self, value):
        self.assertTrue(is_a_greeting(value))
github Telefonica / toolium-examples / tests / web / test_web_datadriven.py View on Github external
    @file_data('datadriven_users.json')
    def test_wrong_login_file(self, user):
        self.common_wrong_login(user)
github datadriventests / ddt / test / test_example.py View on Github external
    @file_data("test_data_dict_dict.yaml")
    def test_file_data_yaml_dict_dict(self, start, end, value):
        self.assertLess(start, end)
        self.assertLess(value, end)
        self.assertGreater(value, start)
github datadriventests / ddt / test / test_example.py View on Github external
    @file_data("test_data_dict_dict.json")
    def test_file_data_json_dict_dict(self, start, end, value):
        self.assertLess(start, end)
        self.assertLess(value, end)
        self.assertGreater(value, start)
github pglass / sqlitis / tests / test_cli.py View on Github external
    @ddt.file_data("cli_data.yaml")
    def test_cli(self, sql, exitcode, stdout, stderr):
        # We have '\n' in the YAML file, but '\r\n' is printed on Windows.
        stdout = stdout.replace("\n", os.linesep)
        stderr = stderr.replace("\n", os.linesep)
        ret, out, err = run_cmd(["sqlitis", sql])
        self.assertEqual(ret, exitcode)
        self.assertEqual(out, stdout)
        self.assertEqual(err, stderr)
github WSDOT / fb-comment-downloader / src / test_validation.py View on Github external
    @file_data('test_data_urls.json')
    def test_page_name_match(self, test_url):

        page_name = get_page_name_from_fb_url(test_url)

        self.assertEqual(
                page_name,
                expected_page_name,
                'page_name {0} did not match expected name {1} '.format(page_name, expected_page_name))
github datadriventests / ddt / test / test_functional.py View on Github external
    @file_data("test_data_dict_missing.yaml")
    def test_something_again(self, value):
        return value