コード例 #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)
コード例 #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)
コード例 #3
0
ファイル: test-cli.py プロジェクト: akissa/sachannelupdate
 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
         )
コード例 #4
0
ファイル: test-cli.py プロジェクト: akissa/sachannelupdate
 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)
コード例 #5
0
ファイル: test-cli.py プロジェクト: akissa/sachannelupdate
 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)
コード例 #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)