示例#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)
示例#2
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)
示例#3
0
 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'
示例#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'
示例#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']
示例#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'
示例#7
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']
示例#8
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'
示例#9
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']
示例#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']
示例#11
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
示例#12
0
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
示例#13
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']
示例#14
0
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
示例#15
0
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
示例#16
0
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
示例#17
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']
示例#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']
示例#19
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'
示例#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']
示例#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
示例#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'
示例#23
0
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
示例#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
示例#25
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
示例#26
0
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)