Esempio n. 1
0
 def test_parse_args(self):
     with mock.patch.object(sys, 'argv', ['', 'current', 'deps', '-d',
                                          'centos7', '-b', 'liberty',
                                          '-o', 'test']):
         args = main._parse_args()
     self.assertEqual(['current', 'deps'], args.repos)
     self.assertEqual('centos7', args.distro)
     self.assertEqual('liberty', args.branch)
     self.assertEqual('test', args.output_path)
Esempio n. 2
0
 def test_parse_args(self):
     with mock.patch.object(sys, 'argv', ['', 'current', 'deps', '-d',
                                          'centos7', '-b', 'liberty',
                                          '-o', 'test']):
         args = main._parse_args()
     self.assertEqual(['current', 'deps'], args.repos)
     self.assertEqual('centos7', args.distro)
     self.assertEqual('liberty', args.branch)
     self.assertEqual('test', args.output_path)
Esempio n. 3
0
 def test_parse_args_long(self):
     with mock.patch.object(sys, 'argv', [
             '', 'current', '--distro', 'centos7', '--branch', 'mitaka',
             '--output-path', 'test'
     ]):
         args = main._parse_args()
     self.assertEqual(['current'], args.repos)
     self.assertEqual('centos7', args.distro)
     self.assertEqual('mitaka', args.branch)
     self.assertEqual('test', args.output_path)
Esempio n. 4
0
 def test_parse_args_long(self):
     with mock.patch.object(sys, 'argv', ['', 'current', '--distro',
                                          'centos7', '--branch',
                                          'mitaka', '--output-path',
                                          'test']):
         args = main._parse_args()
     self.assertEqual(['current'], args.repos)
     self.assertEqual('centos7', args.distro)
     self.assertEqual('mitaka', args.branch)
     self.assertEqual('test', args.output_path)
Esempio n. 5
0
 def test_main_centos8(self, mock_install, mock_remove, mock_gbp,
                       mock_validate, mock_clean, mock_distro):
     mock_distro.return_value = ('centos', '8', 'CentOS 8')
     args = main._parse_args('centos', '8')
     mock_path = mock.Mock()
     mock_gbp.return_value = mock_path
     main.main()
     mock_validate.assert_called_once_with(args, 'CentOS 8', '8')
     mock_gbp.assert_called_once_with(args)
     mock_remove.assert_called_once_with(args)
     mock_clean.assert_called_once_with('centos8')
Esempio n. 6
0
 def test_main_fedora(self, mock_install, mock_remove, mock_ip, mock_gbp,
                      mock_validate, mock_clean):
     args = main._parse_args()
     mock_path = mock.Mock()
     mock_gbp.return_value = mock_path
     main.main()
     mock_validate.assert_called_once_with(args)
     mock_gbp.assert_called_once_with(args)
     assert not mock_ip.called, '_install_priorities should no tbe called'
     mock_remove.assert_called_once_with(args)
     mock_install.assert_called_once_with(args, mock_path)
     mock_clean.assert_called_once_with('fedora')
Esempio n. 7
0
 def test_main(self, mock_install, mock_remove, mock_ip, mock_gbp,
               mock_validate, mock_clean):
     args = main._parse_args()
     mock_path = mock.Mock()
     mock_gbp.return_value = mock_path
     main.main()
     mock_validate.assert_called_once_with(args)
     mock_gbp.assert_called_once_with(args)
     mock_ip.assert_called_once_with()
     mock_remove.assert_called_once_with(args)
     mock_install.assert_called_once_with(args, mock_path)
     mock_clean.assert_called_once_with('centos7')