Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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']
Exemplo n.º 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'
Exemplo n.º 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']
Exemplo n.º 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'
Exemplo n.º 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']
Exemplo n.º 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']
Exemplo n.º 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
Exemplo n.º 12
0
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
Exemplo n.º 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']
Exemplo n.º 14
0
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
Exemplo n.º 15
0
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
Exemplo n.º 16
0
 def test_index_url_shortcut(self):
     argv = ['files', 'mock', '-i', 'internal']
     options = commands.parse_args(argv)
     assert options.index == 'internal'
Exemplo n.º 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']
Exemplo n.º 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']
Exemplo n.º 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'
Exemplo n.º 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']
Exemplo n.º 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
Exemplo n.º 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'
Exemplo n.º 23
0
 def test_no_arguments(self):
     argv = []
     with pytest.raises(SystemExit):
         commands.parse_args(argv)
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 26
0
 def test_no_index_url(self):
     argv = ['files', 'mock']
     with pytest.raises(SystemExit):
         commands.parse_args(argv)