Пример #1
0
 def test_run(self, mock1, mock2, mock3, mock4, mock5, mock6):
     self.segstop.db = '/tmp/gpseg0:1234'
     self.segstop.mode = 'smart'
     self.segstop.timeout = '10'
     expected = SegStopStatus('/tmp/gpseg0', True, 'Shutdown Succeeded')
     result = self.segstop.run()
     self.assertEqual(str(expected), str(result))
Пример #2
0
 def test_run_with_pg_controldata_error_in_immediate_mode(
         self, mock1, mock2, mock3, mock4, mock5, mock6):
     self.segstop.db = '/tmp/gpseg0:1234'
     self.segstop.mode = 'immediate'
     self.segstop.timeout = '10'
     expected = SegStopStatus('/tmp/gpseg0', True, 'Shutdown Immediate')
     result = self.segstop.run()
     self.assertEqual(str(expected), str(result))
Пример #3
0
 def test_run_with_error(self, mock1, mock2, mock3, mock4, mock5, mock6):
     self.segstop.db = '/tmp/gpseg0:1234'
     self.segstop.mode = 'smart'
     self.segstop.timeout = '10'
     expected = SegStopStatus('/tmp/gpseg0', True,
                              'Forceful termination success')
     result = self.segstop.run()
     self.assertIn(str(expected), str(result))