<commit_before>import unittest

from mock import patch

from mnp.commands import *

class DownloadTest(unittest.TestCase):
    @patch("subprocess.check_call")
    def test_download_one(self, mockSubprocess):
        download(["package1"], "indexUrl1")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl1"])

    @patch("subprocess.check_call")
    def test_download_multiple(self, mockSubprocess):
        download(["package1", "package2", "package3"], "indexUrl1")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "package2", "package3", "--extra-index-url", "indexUrl1"])

    @patch("subprocess.check_call")
    def test_download_indexUrl2(self, mockSubprocess):
        download(["package1"], "indexUrl2")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl2"])

    @patch("subprocess.check_call")
    def test_download_additional_args(self, mockSubprocess):
        download(["package1"], "indexUrl1", ["-v", "-v", "-v"])
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl1", "-v", "-v", "-v"])<commit_msg>Add test for upload<commit_after>import unittest

from mock import patch

from mnp.commands import *

class DownloadTest(unittest.TestCase):
    @patch("subprocess.check_call")
    def test_download_one(self, mockSubprocess):
        download(["package1"], "indexUrl1")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl1"])

    @patch("subprocess.check_call")
    def test_download_multiple(self, mockSubprocess):
        download(["package1", "package2", "package3"], "indexUrl1")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "package2", "package3", "--extra-index-url", "indexUrl1"])

    @patch("subprocess.check_call")
    def test_download_indexUrl2(self, mockSubprocess):
        download(["package1"], "indexUrl2")
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl2"])

    @patch("subprocess.check_call")
    def test_download_additional_args(self, mockSubprocess):
        download(["package1"], "indexUrl1", ["-v", "-v", "-v"])
        mockSubprocess.assert_called_once_with(["pip", "install", "package1", "--extra-index-url", "indexUrl1", "-v", "-v", "-v"])

class NormalUploadTest(unittest.TestCase):
    @patch("subprocess.check_call")
    def test_normal_upload_simple(self, mockSubprocess):
        normal_upload("default")
        mockSubprocess.assert_called_once_with(["python", "setup.py", "register", "-r", "default", "sdist", "upload", "-r", "default"])

    @patch("subprocess.check_call")
    def test_normal_upload_additional_args(self, mockSubprocess):
        normal_upload("default", ["anything", "everything"])
        mockSubprocess.assert_called_once_with(["python", "setup.py", "register", "-r", "default", "sdist", "upload", "-r", "default", "anything", "everything"])

class GitHubUploadTest(unittest.TestCase):
    @patch("subprocess.check_call")
    def test_github_upload_simple(self, mockSubprocess):
        github_upload("default")
        mockSubprocess.assert_called_once_with(["python", "setup.py", "github_register", "-r", "default", "sdist", "github_upload", "-r", "default"])

    @patch("subprocess.check_call")
    def test_github_upload_additional_args(self, mockSubprocess):
        github_upload("default", ["anything", "everything"])
        mockSubprocess.assert_called_once_with(["python", "setup.py", "github_register", "-r", "default", "sdist", "github_upload", "-r", "default", "anything", "everything"])
{'fraction_non_alphanumeric': 0.17659688674181429, 'fraction_numerical': 0.011272141706924315, 'mean_word_length': 5.295608108108108, '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': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4118902', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1147, 'n_words': 200}