예제 #1
0
    def test_run_program(self, mock_inst):
        """Function:  test_run_program

        Description:  Test run_program function.

        Arguments:

        """

        mock_inst.return_value = self.server

        self.assertFalse(
            mongo_db_dump.run_program(self.args_array, self.func_dict))
예제 #2
0
    def test_email_no_subj(self, mock_inst):
        """Function:  test_email_no_subj

        Description:  Test with no subject line passed.

        Arguments:

        """

        mock_inst.return_value = self.server

        self.assertFalse(
            mongo_db_dump.run_program(self.args_array2, self.func_dict))
예제 #3
0
    def test_suppress_success(self, mock_inst):
        """Function:  test_suppress_success

        Description:  Test with successful dump and suppression.

        Arguments:

        """

        mock_inst.return_value = self.server

        self.assertFalse(
            mongo_db_dump.run_program(self.args_array, self.func_dict))
예제 #4
0
    def test_dump_error(self, mock_inst):
        """Function:  test_dump_error

        Description:  Test with dump returning error.

        Arguments:

        """

        mock_inst.return_value = self.server

        with gen_libs.no_std_out():
            self.assertFalse(
                mongo_db_dump.run_program(self.args_array, self.func_dict2))
예제 #5
0
    def test_suppress_failure(self, mock_inst):
        """Function:  test_suppress_failure

        Description:  Test with dump failure and suppression.

        Arguments:

        """

        mock_inst.return_value = self.server

        with gen_libs.no_std_out():
            self.assertFalse(
                mongo_db_dump.run_program(self.args_array4, self.func_dict2))
예제 #6
0
    def test_connect_failure(self, mock_inst):
        """Function:  test_connect_failure

        Description:  Test with connection failure.

        Arguments:

        """

        self.server.status = False
        self.server.errmsg = "Connection failure"
        mock_inst.return_value = self.server

        with gen_libs.no_std_out():
            self.assertFalse(
                mongo_db_dump.run_program(self.args_array, self.func_dict))