<commit_before>from twine import cli
from twine import utils


def test_devpi_upload(devpi_server, uploadable_dist, monkeypatch):
    command = [
        "upload",
        "--repository-url",
        devpi_server.url,
        "--username",
        devpi_server.username,
        "--password",
        devpi_server.password,
        str(uploadable_dist),
    ]

    # Patching validate url to validate devpi server url by allowing http
    monkeypatch.setattr(utils, "validate_url", lambda repository_url: True)
    cli.dispatch(command)


twine_sampleproject_token = (
    "<KEY>"
    "<KEY>"
    "<KEY>"
    "<KEY>"
    "<KEY>"
)


def test_pypi_upload(sampleproject_dist):
    command = [
        "upload",
        "--repository-url",
        "https://test.pypi.org/legacy/",
        "--username",
        "__token__",
        "--password",
        twine_sampleproject_token,
        str(sampleproject_dist),
    ]
    cli.dispatch(command)


def test_pypiserver_upload(pypiserver_instance, uploadable_dist, monkeypatch):
    command = [
        "upload",
        "--repository-url",
        pypiserver_instance.url,
        "--username",
        "any",
        "--password",
        "any",
        str(uploadable_dist),
    ]

    # Patching validate url to validate devpi server url by allowing http
    monkeypatch.setattr(utils, "validate_url", lambda repository_url: True)
    cli.dispatch(command)<commit_msg>Revert patching of integration test<commit_after>from twine import cli


def test_devpi_upload(devpi_server, uploadable_dist):
    command = [
        "upload",
        "--repository-url",
        devpi_server.url,
        "--username",
        devpi_server.username,
        "--password",
        devpi_server.password,
        str(uploadable_dist),
    ]
    cli.dispatch(command)


twine_sampleproject_token = (
    "<KEY>"
    "<KEY>"
    "<KEY>"
    "<KEY>"
    "<KEY>"
)


def test_pypi_upload(sampleproject_dist):
    command = [
        "upload",
        "--repository-url",
        "https://test.pypi.org/legacy/",
        "--username",
        "__token__",
        "--password",
        twine_sampleproject_token,
        str(sampleproject_dist),
    ]
    cli.dispatch(command)


def test_pypiserver_upload(pypiserver_instance, uploadable_dist):
    command = [
        "upload",
        "--repository-url",
        pypiserver_instance.url,
        "--username",
        "any",
        "--password",
        "any",
        str(uploadable_dist),
    ]
    cli.dispatch(command)
{'fraction_non_alphanumeric': 0.1269968051118211, 'fraction_numerical': 0.0, 'mean_word_length': 2.2830930537352554, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '209084', 'n_tokens_mistral': 790, 'n_tokens_neox': 773, 'n_words': 137}