Exemplo n.º 1
0
 def test_main_cf_exp(self, mock_entry, mock_error):
     config = os.path.join(os.path.dirname(__file__), 'sa.ini')
     mock_entry.side_effect = SaChannelUpdateError("xxx")
     sys.argv = ['__main__', '-c', config]
     main()
     self.assertTrue(mock_entry.called)
     self.assertTrue(mock_error.called)
Exemplo n.º 2
0
 def test_main_no_cf(self):
     default_cfg = '/etc/sachannelupdate/sachannelupdate.ini'
     sys.argv = ['__main__', '-c', default_cfg]
     with self.assertRaises(SaChannelUpdateConfigError) as cma:
         main()
         self.assertEqual(
             cma.exception.message,
             'The configuration file: %s does not exist' % default_cfg)
Exemplo n.º 3
0
 def test_main_no_cf(self):
     default_cfg = '/etc/sachannelupdate/sachannelupdate.ini'
     sys.argv = ['__main__', '-c', default_cfg]
     with self.assertRaises(SaChannelUpdateConfigError) as cma:
         main()
         self.assertEqual(
             cma.exception.message,
             'The configuration file: %s does not exist' % default_cfg
         )
Exemplo n.º 4
0
 def test_main_cf_exp(self, mock_entry, mock_error):
     config = os.path.join(
         os.path.dirname(__file__),
         'sa.ini'
     )
     mock_entry.side_effect = SaChannelUpdateError("xxx")
     sys.argv = ['__main__', '-c', config]
     main()
     self.assertTrue(mock_entry.called)
     self.assertTrue(mock_error.called)
Exemplo n.º 5
0
 def test_main_cf(self, mock_entry):
     config = os.path.join(os.path.dirname(__file__), 'sa.ini')
     sys.argv = ['__main__', '-c', config]
     main()
     self.assertTrue(mock_entry.called)
Exemplo n.º 6
0
 def test_main_cf(self, mock_entry):
     config = os.path.join(os.path.dirname(__file__), 'sa.ini')
     sys.argv = ['__main__', '-c', config]
     main()
     self.assertTrue(mock_entry.called)