Ejemplo n.º 1
0
 def test_dispatch_calls_only_bbpgsql_error(self,
     mock_restorewal_main,
     mock_archivepgsql_main, mock_archivewal_main, mock_bbpgsql_error):
     bbpgsql_main(self.get_argv_for_cmd(self.bbpgsql_exe))
     mock_bbpgsql_error.assert_called_once_with()
     self.assertFalse(mock_archivepgsql_main.called)
     self.assertFalse(mock_archivewal_main.called)
     self.assertFalse(mock_restorewal_main.called)
Ejemplo n.º 2
0
 def test_invocation_using_unknown_fails(self,
     mock_exit, mock_stdout_write):
     bbpgsql_main(['unknown'])
     mock_stdout_write.assert_called_once_with(self.unknownMsg)
     mock_exit.assert_called_once_with(1)
Ejemplo n.º 3
0
 def test_invocation_using_main_script_fails(self,
     mock_exit):
     bbpgsql_main(['bbpgsql', '-c', self.config_path])
     mock_exit.assert_called_with(1)