Ejemplo n.º 1
0
    def test_status_true(self, mock_mail, mock_prepare, mock_move, mock_log):
        """Function:  test_status_true

        Description:  Test with status set to True.

        Arguments:

        """

        mock_log.return_value = True
        mock_mail.return_value = True
        mock_prepare.return_value = (self.subj, self.body)
        mock_move.return_value = True

        self.assertFalse(
            merge_repo.post_process(self.gitr, self.cfg, mock_log,
                                    self.status1))
Ejemplo n.º 2
0
    def test_no_email(self, mock_move, mock_log):
        """Function:  test_no_email

        Description:  Test with no email notifications.

        Arguments:

        """

        mock_log.return_value = True
        mock_move.return_value = True

        msg = {"1": "Line1", "2": "Line2"}
        self.cfg.to_line = None

        self.assertFalse(
            merge_repo.post_process(self.gitr,
                                    self.cfg,
                                    mock_log,
                                    self.status1,
                                    msg=msg))
Ejemplo n.º 3
0
    def test_msg_passed(self, mock_mail, mock_prepare, mock_move, mock_log):
        """Function:  test_msg_passed

        Description:  Test with msg passed with data.

        Arguments:

        """

        mock_log.return_value = True
        mock_mail.return_value = True
        mock_prepare.return_value = (self.subj, self.body)
        mock_move.return_value = True

        msg = {"1": "Line1", "2": "Line2"}

        self.assertFalse(
            merge_repo.post_process(self.gitr,
                                    self.cfg,
                                    mock_log,
                                    self.status1,
                                    msg=msg))
Ejemplo n.º 4
0
    def test_linelist_passed(self, mock_mail, mock_prepare, mock_move,
                             mock_log):
        """Function:  test_linelist_passed

        Description:  Test with line_list passed with data.

        Arguments:

        """

        mock_log.return_value = True
        mock_mail.return_value = True
        mock_prepare.return_value = (self.subj, self.body)
        mock_move.return_value = True

        line_list = ["Line1", "Line2"]

        self.assertFalse(
            merge_repo.post_process(self.gitr,
                                    self.cfg,
                                    mock_log,
                                    self.status1,
                                    line_list=line_list))