'Run a set of 5 html files through all grep plugins.
As with the previous test, the only thing we want to see is if the grep
plugin crashes or not. We\'re not asserting any results.'

@patch('w3af.plugins.grep.motw.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.password_profiling.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.meta_tags.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.lang.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.code_disclosure.is_404', side_effect=repeat(False))
def test_all_grep_plugins(self, *args):

    def profile_me():
        '\n                                                To    be    profiled\n                                                '
        for _ in xrange(1):
            for counter in xrange(1, 5):
                file_name = (('test-' + str(counter)) + '.html')
                file_path = os.path.join(ROOT_PATH, 'plugins', 'tests', 'grep', 'data', file_name)
                body = file(file_path).read()
                hdrs = Headers({'Content-Type': 'text/html'}.items())
                response = HTTPResponse(200, body, hdrs, URL((self.url_str + str(counter))), URL((self.url_str + str(counter))), _id=random.randint(1, 5000))
                request = FuzzableRequest(self.url_inst)
                for pinst in self._plugins:
                    pinst.grep(request, response)
        for pinst in self._plugins:
            pinst.end()
    if self.PROFILING:
        cProfile.run('profile_me()', 'output.stats')
    else:
        profile_me()
