<commit_before>from msl.package_manager import utils, install, uninstall


def test_install_then_uninstall():

    # make sure that MSL-IO is not installed
    pkgs = utils.installed()
    assert 'msl-io' not in pkgs

    # install from PyPI
    install('io', yes=True)

    # make sure that MSL-IO is installed
    pkgs = utils.installed()
    assert 'msl-io' in pkgs

    uninstall('io', yes=True)

    # make sure that MSL-IO is not installed
    pkgs = utils.installed()
    assert 'msl-io' not in pkgs<commit_msg>uninstall msl-io if previously installed<commit_after>from msl.package_manager import utils, install, uninstall


def test_install_then_uninstall():

    # make sure that MSL-IO is not installed
    pkgs = utils.installed()
    if 'msl-io' in pkgs:
        uninstall('io', yes=True)
    pkgs = utils.installed()
    assert 'msl-io' not in pkgs

    # install MSL-IO
    install('io', yes=True)

    # make sure that MSL-IO is installed
    pkgs = utils.installed()
    assert 'msl-io' in pkgs

    uninstall('io', yes=True)

    # make sure that MSL-IO is not installed
    pkgs = utils.installed()
    assert 'msl-io' not in pkgs
{'fraction_non_alphanumeric': 0.09930313588850175, 'fraction_numerical': 0.0, 'mean_word_length': 3.031578947368421, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1984901', 'n_tokens_mistral': 406, 'n_tokens_neox': 381, 'n_words': 120}