Beispiel #1
0
 def test_files_no_use_wheel(self):
     argv = [
         'files', 'requests==1.0.1', 'mock',
         '-i', 'internal',
         '--no-use-wheel',
     ]
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
 def test_files_no_use_wheel(self):
     argv = [
         'files',
         'requests==1.0.1',
         'mock',
         '-i',
         'internal',
         '--no-use-wheel',
     ]
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
 def test_requirements_download_dir_shortcut(self):
     argv = [
         'requirements', 'requirements.txt', '-i', 'internal', '-d',
         '~/.packages'
     ]
     options = commands.parse_args(argv)
     assert options.download_dir == '~/.packages'
     assert options.command == 'requirements'
     assert options.requirements_file == 'requirements.txt'
Beispiel #4
0
 def test_requirements_no_use_wheel(self):
     argv = [
         'requirements', 'requirements.txt',
         '-i', 'internal',
         '--no-use-wheel',
     ]
     options = commands.parse_args(argv)
     assert options.no_use_wheel
     assert options.command == 'requirements'
Beispiel #5
0
 def test_packages_download_dir(self):
     argv = [
         'packages', 'mock', '-i', 'internal',
         '--download-dir', '~/.packages'
     ]
     options = commands.parse_args(argv)
     assert options.download_dir == '~/.packages'
     assert options.command == 'packages'
     assert options.packages == ['mock']
Beispiel #6
0
 def test_requirements_download_dir(self):
     argv = [
         'requirements', 'requirements.txt', '-i', 'internal',
         '--download-dir', '~/.packages'
     ]
     options = commands.parse_args(argv)
     assert options.download_dir == '~/.packages'
     assert options.command == 'requirements'
     assert options.requirements_file == 'requirements.txt'
 def test_packages_download_dir(self):
     argv = [
         'packages', 'mock', '-i', 'internal', '--download-dir',
         '~/.packages'
     ]
     options = commands.parse_args(argv)
     assert options.download_dir == '~/.packages'
     assert options.command == 'packages'
     assert options.packages == ['mock']
 def test_requirements_no_use_wheel(self):
     argv = [
         'requirements',
         'requirements.txt',
         '-i',
         'internal',
         '--no-use-wheel',
     ]
     options = commands.parse_args(argv)
     assert options.no_use_wheel
     assert options.command == 'requirements'
 def test_username_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal', '-u', 'foo']
     options = commands.parse_args(argv)
     assert options.username == 'foo'
     assert options.command == 'files'
     assert options.files == ['mock']
Beispiel #10
0
 def test_password_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal', '-p', 'bar']
     options = commands.parse_args(argv)
     assert options.password == 'bar'
     assert options.command == 'files'
     assert options.files == ['mock']
 def test_packages(self):
     argv = ['packages', 'requests==1.0.1', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'packages'
     assert options.packages == ['requests==1.0.1', 'mock']
     assert not options.no_use_wheel
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
 def test_files(self):
     argv = ['files', 'requests==1.0.1', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'files'
     assert options.files == ['requests==1.0.1', 'mock']
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
Beispiel #16
0
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
 def test_password_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal', '-p', 'bar']
     options = commands.parse_args(argv)
     assert options.password == 'bar'
     assert options.command == 'files'
     assert options.files == ['mock']
Beispiel #18
0
 def test_username_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal', '-u', 'foo']
     options = commands.parse_args(argv)
     assert options.username == 'foo'
     assert options.command == 'files'
     assert options.files == ['mock']
 def test_packages_no_use_wheel(self):
     argv = ['packages', 'mock', '-i', 'internal', '--no-use-wheel']
     options = commands.parse_args(argv)
     assert options.no_use_wheel
     assert options.command == 'packages'
Beispiel #20
0
 def test_files(self):
     argv = ['files', 'requests==1.0.1', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'files'
     assert options.files == ['requests==1.0.1', 'mock']
Beispiel #21
0
 def test_requirements(self):
     argv = ['requirements', 'requirements.txt', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'requirements'
     assert options.requirements_file == 'requirements.txt'
     assert not options.no_use_wheel
Beispiel #22
0
 def test_packages_no_use_wheel(self):
     argv = ['packages', 'mock', '-i', 'internal', '--no-use-wheel']
     options = commands.parse_args(argv)
     assert options.no_use_wheel
     assert options.command == 'packages'
Beispiel #23
0
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
Beispiel #24
0
 def test_packages(self):
     argv = ['packages', 'requests==1.0.1', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'packages'
     assert options.packages == ['requests==1.0.1', 'mock']
     assert not options.no_use_wheel
 def test_requirements(self):
     argv = ['requirements', 'requirements.txt', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.command == 'requirements'
     assert options.requirements_file == 'requirements.txt'
     assert not options.no_use_wheel
Beispiel #26
0
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)