コード例 #1
0
    def test_no_rep_info(self, mock_mst, mock_prt):
        """Function:  test_no_rep_info

        Description:  Test with no replication information.

        Arguments:

        """

        mock_mst.return_value = self.get_master
        mock_prt.return_value = True

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status2,
                                            json=True,
                                            args_array=self.args_array,
                                            optdt=self.optdt), self.status)
コード例 #2
0
    def test_json_stdout(self, mock_mst, mock_prt):
        """Function:  test_json_stdout

        Description:  Test with JSON format to standard out.

        Arguments:

        """

        mock_mst.return_value = self.get_master
        mock_prt.return_value = True

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            json=True,
                                            args_array=self.args_array2,
                                            optdt=self.optdt), self.status)
コード例 #3
0
    def test_std_out_suppress(self, mock_mst):
        """Function:  test_std_out_suppress

        Description:  Test with standard out suppressed.

        Arguments:

        """

        mock_mst.return_value = self.get_master

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            optdt=self.optdt,
                                            suf=self.primary,
                                            args_array=self.args_array),
            self.status)
コード例 #4
0
    def test_std_out_file(self, mock_mst):
        """Function:  test_std_out_file

        Description:  Test with standard out writing to file.

        Arguments:

        """

        mock_mst.return_value = self.get_master

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            ofile="Filename",
                                            args_array=self.args_array,
                                            optdt=self.optdt,
                                            suf=self.primary), self.status)
コード例 #5
0
    def test_file(self, mock_mst, mock_file):
        """Function:  test_file

        Description:  Test with writing to file.

        Arguments:

        """

        mock_mst.return_value = self.get_master
        mock_file.return_value = True

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            json=True,
                                            ofile="Filename",
                                            args_array=self.args_array,
                                            optdt=self.optdt), self.status)
コード例 #6
0
    def test_mongo(self, mock_mst, mock_mongo):
        """Function:  test_mongo

        Description:  Test with writing to mongo.

        Arguments:

        """

        mock_mst.return_value = self.get_master
        mock_mongo.return_value = self.conn

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            json=True,
                                            class_cfg="mongocfg",
                                            db_tbl=self.db_tbl,
                                            args_array=self.args_array,
                                            optdt=self.optdt), self.status)
コード例 #7
0
    def test_std_out_mongo_success(self, mock_mst, mock_mongo):
        """Function:  test_std_out_mongo_success

        Description:  Test with successful connection to Mongo.

        Arguments:

        """

        mock_mst.return_value = self.get_master
        mock_mongo.return_value = self.conn

        self.assertEqual(
            mongo_rep_admin.chk_mem_rep_lag(self.rep_status,
                                            class_cfg="mongocfg",
                                            db_tbl=self.db_tbl,
                                            args_array=self.args_array,
                                            optdt=self.optdt,
                                            suf=self.primary), self.status)