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