'Test _check_python_file_is_safe with triple quotes.'

@data({'python': '\n                                                                                response_str    =    textwrap.dedent(\'\'\'\n                                                                                                <div>\n                                                                                                                <h3    class="result">{response}</h3>\n                                                                                                </div>\n                                                                                \'\'\').format(response=response_text)\n                                                                ', 'rule': Rules.python_wrap_html, 'start_line': 2}, {'python': '\n                                                                def    function(self):\n                                                                                \'\'\'\n                                                                                Function    comment.\n                                                                                \'\'\'\n                                                                                response_str    =    textwrap.dedent(\'\'\'\n                                                                                                <div>\n                                                                                                                <h3    class="result">{response}</h3>\n                                                                                                </div>\n                                                                                \'\'\').format(response=response_text)\n                                                                ', 'rule': Rules.python_wrap_html, 'start_line': 6}, {'python': '\n                                                                def    function(self):\n                                                                                \'\'\'\n                                                                                Function    comment.\n                                                                                \'\'\'\n                                                                                response_str    =    \'\'\'<h3    class="result">{response}</h3>\'\'\'.format(response=response_text)\n                                                                ', 'rule': Rules.python_wrap_html, 'start_line': 6}, {'python': '\n                                                                def    function(self):\n                                                                                \'\'\'\n                                                                                Function    comment.\n                                                                                \'\'\'\n                                                                                response_str    =    textwrap.dedent(\'\'\'\n                                                                                                <div>\n                                                                                                                """    Do    we    care    about    a    nested    triple    quote?    """\n                                                                                                                <h3    class="result">{response}</h3>\n                                                                                                </div>\n                                                                                \'\'\').format(response=response_text)\n                                                                ', 'rule': Rules.python_wrap_html, 'start_line': 6})
def test_check_python_with_triple_quotes(self, data):

    linter = PythonLinter()
    results = FileResults('')
    file_content = textwrap.dedent(data['python'])
    linter.check_python_file_is_safe(file_content, results)
    self._validate_data_rules(data, results)
    self.assertEqual(results.violations[0].start_line, data['start_line'])
