'In this case the number of generated mutants is higher due to the
encoded and double encoded versions which are returned. In the previous
case, and given that both the encoded and double encoded versions were
the same, the number of generated mutants was 4.'

def test_valid_results_double_encoding(self):

    payloads = ['ls    -    la', 'ping    127.0.0.1    -c    5', 'http://127.0.0.1:8015/test/']
    freq = FuzzableRequest(URL('http://www.w3af.com/foo/bar'))
    generated_mutants = URLPartsMutant.create_mutants(freq, payloads, [], False, self.fuzzer_config)
    expected_urls = ['http://www.w3af.com/ls+-+la/bar', 'http://www.w3af.com/ls%2B-%2Bla/bar', 'http://www.w3af.com/ping+127.0.0.1+-c+5/bar', 'http://www.w3af.com/ping%2B127.0.0.1%2B-c%2B5/bar', 'http://www.w3af.com/foo/ls+-+la', 'http://www.w3af.com/foo/ls%2B-%2Bla', 'http://www.w3af.com/foo/ping+127.0.0.1+-c+5', 'http://www.w3af.com/foo/ping%2B127.0.0.1%2B-c%2B5', 'http://www.w3af.com/http%3A%2F%2F127.0.0.1%3A8015%2Ftest%2F/bar', 'http://www.w3af.com/http%253A%252F%252F127.0.0.1%253A8015%252Ftest%252F/bar', 'http://www.w3af.com/foo/http%3A%2F%2F127.0.0.1%3A8015%2Ftest%2F', 'http://www.w3af.com/foo/http%253A%252F%252F127.0.0.1%253A8015%252Ftest%252F']
    generated_urls = set([m.get_url().url_string for m in generated_mutants])
    self.assertEqual(set(expected_urls), generated_urls)
