示例#1
0
    def test_std_suppress(self):
        """Function:  test_std_suppress

        Description:  Test with standard out suprressed.

        Arguments:

        """

        self.assertEqual(mongo_db_admin.status(self.server, self.args_array3),
                         (False, None))
示例#2
0
    def test_to_standard(self, mock_print):
        """Function:  test_to_standard

        Description:  Test going to standard out.

        Arguments:

        """

        mock_print.return_value = True

        self.assertEqual(mongo_db_admin.status(self.server, self.args_array),
                         (False, None))
示例#3
0
    def test_to_json_file(self, mock_file):
        """Function:  test_to_json_file

        Description:  Test with JSON to file.

        Arguments:

        """

        mock_file.return_value = True

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array2,
                                  ofile="filename"), (False, None))
示例#4
0
    def test_to_file(self, mock_lib):
        """Function:  test_to_file

        Description:  Test going to file.

        Arguments:

        """

        mock_lib.write_file.return_value = True
        mock_lib.openfile.return_value = "FileHandler"

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array3,
                                  ofile="Outfile"), (False, None))
示例#5
0
    def test_to_json_db(self, mock_db):
        """Function:  test_to_json_db

        Description:  Test with JSON to database.

        Arguments:

        """

        mock_db.return_value = (True, None)

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array2,
                                  class_cfg="mongo_cfg",
                                  db_tbl=self.db_tbl), (False, None))
示例#6
0
    def test_to_json_email(self, mock_db, mock_file):
        """Function:  test_to_json_email

        Description:  Test with JSON to email.

        Arguments:

        """

        mock_db.return_value = (True, None)
        mock_file.return_value = True

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array2,
                                  mail=self.mail), (False, None))
示例#7
0
    def test_to_json_both(self, mock_db, mock_file):
        """Function:  test_to_json_both

        Description:  Test with JSON to file and database.

        Arguments:

        """

        mock_db.return_value = (True, None)
        mock_file.return_value = True

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array2,
                                  ofile="filename",
                                  class_cfg="mongo_cfg",
                                  db_tbl=self.db_tbl), (False, None))
示例#8
0
    def test_to_dict_both(self, mock_db, mock_lib):
        """Function:  test_to_dict_both

        Description:  Test with dictionary to file and database.

        Arguments:

        """

        mock_db.return_value = (True, None)
        mock_lib.display_data.return_value = True
        mock_lib.openfile.return_value = "FileHandler"

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array3,
                                  ofile="filename",
                                  class_cfg="mongo_cfg",
                                  db_tbl=self.db_tbl), (False, None))
示例#9
0
    def test_ins_doc_success(self, mock_db, mock_lib):
        """Function:  test_ins_doc_success

        Description:  Test with successful insert into database.

        Arguments:

        """

        mock_db.return_value = (True, None)
        mock_lib.display_data.return_value = True
        mock_lib.openfile.return_value = "FileHandler"

        self.assertEqual(
            mongo_db_admin.status(self.server,
                                  self.args_array3,
                                  ofile="filename",
                                  class_cfg="mongo_cfg",
                                  db_tbl=self.db_tbl,
                                  mail=self.mail), (False, None))