예제 #1
0
    def test_db_dump_locked_mail(self, mock_copy):
        """Function:  test_db_dump_locked_mail

        Description:  Test with database locked and mail.

        Arguments:

        """

        mock_copy.return_value = True

        self.assertEqual((mongo_db_dump.sync_cp_dump(
            self.server, self.args_array, mail=self.mail)), (True, self.msg1))
        self.assertEqual(self.mail.msg, self.msg1a)
예제 #2
0
    def test_db_dump_mail(self, mock_copy):
        """Function:  test_db_dump_mail

        Description:  Test with successful dump and mail.

        Arguments:

        """

        mock_copy.return_value = True

        self.assertEqual((mongo_db_dump.sync_cp_dump(
            self.server3, self.args_array, mail=self.mail)), (False, None))
        self.assertEqual(self.mail.msg, "")
예제 #3
0
    def test_unable_to_lock_mail(self):
        """Function:  test_unable_to_lock_mail

        Description:  Test with database unable to lock it and mail.

        Arguments:

        """

        self.server.locked = False

        self.assertEqual((mongo_db_dump.sync_cp_dump(
            self.server2, self.args_array, mail=self.mail)), (True, self.msg2))
        self.assertEqual(self.mail.msg, self.msg2a)
예제 #4
0
    def test_db_locked_mail(self):
        """Function:  test_db_locked_mail

        Description:  Test with database is locked and mail.

        Arguments:

        """

        self.server.locked = True

        self.assertEqual((mongo_db_dump.sync_cp_dump(
            self.server, self.args_array, mail=self.mail)), (True, self.msg1))
        self.assertEqual(self.mail.msg, self.msg1)
예제 #5
0
    def test_db_locked(self):
        """Function:  test_db_locked

        Description:  Test with database is locked.

        Arguments:

        """

        self.server.locked = True

        self.assertEqual(
            (mongo_db_dump.sync_cp_dump(self.server, self.args_array)),
            (True, self.msg1))
예제 #6
0
    def test_db_dump_locked(self, mock_copy):
        """Function:  test_db_dump_locked

        Description:  Test with dumping of database, but still locked.

        Arguments:

        """

        mock_copy.return_value = True

        self.assertEqual(
            (mongo_db_dump.sync_cp_dump(self.server, self.args_array)),
            (True, self.msg3))
예제 #7
0
    def test_db_dump(self, mock_copy):
        """Function:  test_db_dump

        Description:  Test with database dump successful.

        Arguments:

        """

        mock_copy.return_value = True

        self.assertEqual(
            (mongo_db_dump.sync_cp_dump(self.server3, self.args_array)),
            (False, None))