'Test incdec_number with valid URLs and a count.'

@pytest.mark.parametrize('incdec', ['increment', 'decrement'])
@pytest.mark.parametrize('value', ['{}foo', 'foo{}', 'foo{}bar', '42foo{}'])
@pytest.mark.parametrize('url', ['http://example.com:80/v1/path/{}/test', 'http://example.com:80/v1/query_test?value={}', 'http://example.com:80/v1/anchor_test#{}', 'http://host_{}_test.com:80', 'http://m4ny.c0m:80/number5/3very?where=yes#{}'])
@pytest.mark.parametrize('count', [1, 5, 100])
def test_incdec_number_count(self, incdec, value, url, count):

    base_value = value.format(20)
    if (incdec == 'increment'):
        expected_value = value.format((20 + count))
    else:
        expected_value = value.format((20 - count))
    base_url = QUrl(url.format(base_value))
    expected_url = QUrl(url.format(expected_value))
    new_url = urlutils.incdec_number(base_url, incdec, count, segments={'host', 'path', 'query', 'anchor'})
    assert (new_url == expected_url)
