#!/usr/bin/env python

import os
import imp
gpcrondump_path = os.path.abspath('gpcrondump')
gpcrondump = imp.load_source('gpcrondump', gpcrondump_path)
import unittest2 as unittest
from datetime import datetime
from gppylib import gplog
from gpcrondump import GpCronDump
from gppylib.operations.utils import DEFAULT_NUM_WORKERS
from mock import patch, Mock
from gppylib.operations.dump import MailDumpEvent
from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file
import mock


logger = gplog.get_unittest_logger()

class GpCronDumpTestCase(unittest.TestCase):

    class Options:
        def __init__(self):
            self.masterDataDirectory = ""
            self.interactive = False
            self.clear_dumps_only = False
            self.post_script = None
            self.dump_config = False
            self.history = False
            self.pre_vacuum = False
            self.post_vacuum = False
            self.rollback = False
            self.compress = True
            self.free_space_percent = None
            self.clear_dumps = False
            self.cleanup_date = None
            self.cleanup_total = None
            self.dump_schema = False
            self.dump_databases = ['testdb']
            self.bypass_disk_check = True
            self.backup_set = None
            self.dump_global = False
            self.clear_catalog_dumps = False
            self.batch_default = DEFAULT_NUM_WORKERS
            self.include_dump_tables = None
            self.exclude_dump_tables = None
            self.include_dump_tables_file = None
            self.exclude_dump_tables_file = None
            self.backup_dir = None
            self.encoding = None
            self.output_options = None
            self.report_dir = None
            self.timestamp_key = None
            self.list_backup_files = None
            self.quiet = False
            self.verbose = False
            self.local_dump_prefix = ''
            self.list_filter_tables = None
            self.include_email_file = None
            self.email_details = None
            self.include_schema_file = None
            self.exclude_schema_file = None
            self.exclude_dump_schema = None
            self.dump_stats = None

            ## Enterprise init
            self.incremental = False
            self.ddboost = False
            self.ddboost_hosts = None
            self.ddboost_user = None
            self.ddboost_config_remove = False
            self.ddboost_verify = False
            self.ddboost_remote = None
            self.ddboost_ping = None
            self.ddboost_backupdir = None
            self.replicate = None
            self.max_streams = None
            self.netbackup_service_host = None
            self.netbackup_policy = None
            self.netbackup_schedule = None
            self.netbackup_block_size = None
            self.netbackup_keyword = None

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.GpCronDump.validate_dump_schema')
    @patch('gpcrondump.validate_current_timestamp')
    def test_option_schema_filter_1(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = '/tmp/foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '--schema-file option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.GpCronDump.validate_dump_schema')
    @patch('gpcrondump.validate_current_timestamp')
    def test_option_schema_filter_2(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = '/tmp/foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '--exclude-schema-file option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_3(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '-S option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_4(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '-s option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_5(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.exclude_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-s can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_6(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.include_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-s can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_7(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.exclude_dump_schema = 'foo'
        with self.assertRaisesRegexp(Exception, '-s can not be selected with -S option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_8(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.exclude_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-S can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_9(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.include_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-S can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_10(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = 'foo'
        options.include_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--exclude-schema-file can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_11(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = 'foo'
        options.include_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_12(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = 'foo'
        options.exclude_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_13(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = 'foo'
        options.exclude_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_14(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = 'foo'
        options.include_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_15(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.include_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with -s option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_16(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.exclude_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with -s option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_17(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.include_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with -S option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_18(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.exclude_dump_tables_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '--table-file and --exclude-table-file can not be selected with -S option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_19(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = 'foo'
        options.exclude_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_20(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = 'foo'
        options.include_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with --exclude-schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_21(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = 'foo'
        options.exclude_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_22(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = 'foo'
        options.include_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with --schema-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_23(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.exclude_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with -s option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_24(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.include_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with -s option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_25(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.exclude_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with -S option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_26(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'foo'
        options.include_dump_tables = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, '-t and -T can not be selected with -S option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_27(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = ['information_schema']
        with self.assertRaisesRegexp(Exception, "can not specify catalog schema 'information_schema' using -s option"):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_28(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = ['information_schema']
        with self.assertRaisesRegexp(Exception, "can not specify catalog schema 'information_schema' using -S option"):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_lines_from_file', return_value=['public', 'information_schema'])
    def test_options_schema_filter_29(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, "can not exclude catalog schema 'information_schema' in schema file '/tmp/foo'"):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_lines_from_file', return_value=['public', 'information_schema'])
    def test_options_schema_filter_30(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = '/tmp/foo'
        with self.assertRaisesRegexp(Exception, "can not include catalog schema 'information_schema' in schema file '/tmp/foo'"):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_31(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        timestamp = '20141016010101'
        file = gpcd.get_schema_list_file(dbname)
        self.assertEquals(file, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_32(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = ['public']
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        timestamp = '20141016010101'
        file = gpcd.get_schema_list_file(dbname)
        self.assertTrue(file.startswith('/tmp/schema_list'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_schema_filter_33(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_schema_file = '/tmp/foo'
        write_lines_to_file('/tmp/foo', ['public'])
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        timestamp = '20141016010101'
        file = gpcd.get_schema_list_file(dbname)
        self.assertTrue(file.startswith('/tmp/schema_list'))
        if os.path.exists('/tmp/foo'):
            os.remove('/tmp/foo')

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_include_schema_list_from_exclude_schema', return_value=['public'])
    def test_options_schema_filter_34(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.exclude_schema_file = '/tmp/foo'
        write_lines_to_file('/tmp/foo', ['public'])
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        timestamp = '20141016010101'
        file = gpcd.get_schema_list_file(dbname)
        self.assertTrue(file.startswith('/tmp/schema_list'))
        if os.path.exists('/tmp/foo'):
            os.remove('/tmp/foo')

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_include_schema_list_from_exclude_schema', return_value=['public'])
    def test_options_schema_filter_35(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_schema = 'public'
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        timestamp = '20141016010101'
        file = gpcd.get_schema_list_file(dbname)
        self.assertTrue(file.startswith('/tmp/schema_list'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_lines_from_file', return_value=['public'])
    @patch('gpcrondump.get_user_table_list_for_schema', return_value=['public', 'table1', 'public', 'table2'])
    def test_options_schema_filter_36(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        gpcd = GpCronDump(options, None)
        dbname = 'foo'
        schema_file = '/tmp/foo'
        inc = gpcd.generate_include_table_list_from_schema_file(dbname, schema_file)
        self.assertTrue(inc.startswith('/tmp/include_dump_tables_file'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options1(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, 'include table list can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options2(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_tables = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, 'exclude table list can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options3(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables_file = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, 'include table file can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options4(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_tables_file = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, 'exclude table file can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options10(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.local_dump_prefix = 'foo'
        options.incremental = False
        options.list_filter_tables = True
        try:
            with self.assertRaisesRegexp(Exception, 'list filter tables option requires --prefix and --incremental'):
                cron = GpCronDump(options, None)
        finally:
            options.list_filter_tables = False

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_latest_full_dump_timestamp', return_value='20121225090000')
    def test_options11(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.incremental = True
        cron = GpCronDump(options, None)
        self.assertEquals(cron.full_dump_timestamp, '20121225090000')

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options12(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.incremental = True
        options.dump_databases = 'bkdb,fulldb'
        with self.assertRaisesRegexp(Exception, 'multi-database backup is not supported with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.get_latest_full_dump_timestamp', return_value='20120330090000')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.GpCronDump._get_master_port')
    def test_options13(self, mock, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.incremental = True
        options.dump_databases = ['bkdb']

        #If this is successful then it should not raise an exception
        GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options14(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = 'bkdb'
        options.incremental = False

        #If this is successful then it should not raise an exception
        GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options15(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = 'bkdb,fulldb'
        options.incremental = False

        #If this is successful then it should not raise an exception
        GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options16(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.backup_dir = '/foo1'
        gpcd = GpCronDump(options, None)
        self.assertEquals(gpcd.getBackupDirectoryRoot(), '/foo1')

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options17(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.backup_dir = None
        gpcd = GpCronDump(options, None)
        self.assertEquals(gpcd.getBackupDirectoryRoot(), '/tmp/foobar')

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options18(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_schema = 'foo'
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '-s option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options19(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.clear_dumps = True
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '-c option can not be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options20(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = []
        options.incremental = True
        with self.assertRaisesRegexp(Exception, 'Must supply -x <database name> with incremental option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options21(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.ddboost = True
        options.replicate = False
        options.max_streams = 20
        with self.assertRaisesRegexp(Exception, '--max-streams must be specified along with --replicate'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options22(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.ddboost = True
        options.replicate = True
        options.max_streams = None
        with self.assertRaisesRegexp(Exception, '--max-streams must be specified along with --replicate'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options23(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.ddboost = True
        options.replicate = True
        options.max_streams = 0
        with self.assertRaisesRegexp(Exception, '--max-streams must be a number greater than zero'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options24(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.ddboost = True
        options.replicate = True
        options.max_streams = "abc"
        with self.assertRaisesRegexp(Exception, '--max-streams must be a number greater than zero'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options25(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.ddboost = False
        options.replicate = False
        options.max_streams = 20
        with self.assertRaisesRegexp(Exception, '--replicate and --max-streams cannot be used without --ddboost'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options26(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.list_backup_files = True
        options.timestamp_key = None
        with self.assertRaisesRegexp(Exception, 'Must supply -K option when listing backup files'):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options27(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = 'bkdb,fulldb'
        options.timestamp_key = True
        with self.assertRaisesRegexp(Exception, 'multi-database backup is not supported with -K option'):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options28(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = ['bkdb']
        options.timestamp_key = True
        options.ddboost = True
        options.list_backup_files = True
        with self.assertRaisesRegexp(Exception, 'list backup files not supported with ddboost option'):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options29(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.dump_databases = ['bkdb']
        options.timestamp_key = True
        options.ddboost = True
        options.netbackup_service_host = "mdw"
        options.netbackup_policy = "test_policy"
        options.netbackup_schedule = "test_schedule"
        with self.assertRaisesRegexp(Exception, '--ddboost is not supported with NetBackup'):
            GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_include_exclude_for_dump_database00(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertEquals(inc, None)
        self.assertEquals(exc, None)
 
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.expand_partitions_and_populate_filter_file', return_value='/tmp/include_dump_tables_file')
    @patch('gpcrondump.get_lines_from_file', return_value=['public.t1', 'public.t2'])
    def test_get_include_exclude_for_dump_database01(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.include_dump_tables_file = '/mydir/incfile'
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertTrue(inc.startswith('/tmp/include_dump_tables_file'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.expand_partitions_and_populate_filter_file', return_value='/tmp/include_dump_tables_file')
    @patch('gpcrondump.get_lines_from_file')
    def test_get_include_exclude_for_dump_database02(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.include_dump_tables = ['public.t1', 'public.t2', 'public.t3']
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertTrue(inc.startswith('/tmp/include_dump_tables_file'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_latest_full_dump_timestamp', return_value='20121225090000')
    def test_get_include_exclude_for_dump_database03(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.incremental = True
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertEquals(inc, '/tmp/dirty')
        self.assertEquals(exc, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.expand_partitions_and_populate_filter_file', return_value='/tmp/exclude_dump_tables_file')
    @patch('gpcrondump.get_lines_from_file', return_value=['public.t1', 'public.t2'])
    def test_get_include_exclude_for_dump_database04(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.exclude_dump_tables_file = '/odir/exfile'
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertTrue(exc.startswith('/tmp/exclude_dump_tables_file'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.expand_partitions_and_populate_filter_file', return_value='/tmp/exclude_dump_tables_file')
    @patch('gpcrondump.get_lines_from_file')
    def test_get_include_exclude_for_dump_database06(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.masterDataDirectory = '/tmp/foobar'
        options.exclude_dump_tables = ['public.t4', 'public.t5', 'public.t6']
        gpcd = GpCronDump(options, None)
        dirtyfile = '/tmp/dirty'
        dbname = 'foo'
        (inc, exc) = gpcd.get_include_exclude_for_dump_database(dirtyfile, dbname)
        self.assertTrue(exc.startswith('/tmp/exclude_dump_tables_file'))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.GpCronDump._get_table_names_from_partition_list', side_effect = [['public.aot1', 'public.aot2'], ['public.cot1', 'public.cot2']])
    def test_verify_tablenames_00(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        cron = GpCronDump(options, None)
        ao_partition_list = ['public, aot1, 2190', 'public, aot2, 3190']
        co_partition_list = ['public, cot1, 2190', 'public, cot2, 3190']
        heap_partition_list = ['public.heapt1', 'public.heapt2']
        cron._verify_tablenames(ao_partition_list, co_partition_list, heap_partition_list) #Should not raise an exception

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.GpCronDump._get_table_names_from_partition_list', side_effect = [['public.aot1:asd', 'public.aot2'], ['public.cot1', 'public.cot2:asd']])
    def test_verify_tablenames_00_bad(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        cron = GpCronDump(options, None)
        ao_partition_list = ['public, aot1!asd, 2190', 'public, aot2, 3190']
        co_partition_list = ['public, cot1, 2190', 'public, cot2\nasd, 3190']
        heap_partition_list = ['public, heapt1, 2190', 'public, heapt2!asdasd , 3190']
        with self.assertRaisesRegexp(Exception, ''):
            cron._verify_tablenames(ao_partition_list, co_partition_list, heap_partition_list)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_inserts_with_incremental(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.output_options = ['--inserts']
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '--inserts, --column-inserts, --oids cannot be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_oids_with_incremental(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.output_options = ['--oids']
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '--inserts, --column-inserts, --oids cannot be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_column_inserts_with_incremental(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.output_options = ['--column-inserts']
        options.incremental = True
        with self.assertRaisesRegexp(Exception, '--inserts, --column-inserts, --oids cannot be selected with incremental backup'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_table_names_from_partition_list_00(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        cron = GpCronDump(options, None)
        partition_list = ['public, aot1, 2190', 'public, aot2:aot, 3190']
        expected_output = ['public.aot1', 'public.aot2:aot']
        result = cron._get_table_names_from_partition_list(partition_list)
        self.assertEqual(result, expected_output)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_table_names_from_partition_list_01(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        cron = GpCronDump(options, None)
        partition_list = ['public, aot1, 2190', 'public, aot2,aot, 3190']
        with self.assertRaisesRegexp(Exception, 'Invalid partition entry "public, aot2,aot, 3190"'):
            cron._get_table_names_from_partition_list(partition_list)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter1(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables = 'foo'
        options.include_dump_tables_file = 'foo'
        with self.assertRaisesRegexp(Exception, '-t can not be selected with --table-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter2(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables = 'foo'
        options.exclude_dump_tables_file = 'foo'
        with self.assertRaisesRegexp(Exception, '-t can not be selected with --exclude-table-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter3(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_tables = 'foo'
        options.exclude_dump_tables_file = 'foo'
        with self.assertRaisesRegexp(Exception, '-T can not be selected with --exclude-table-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter4(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.exclude_dump_tables = 'foo'
        options.include_dump_tables_file = 'foo'
        with self.assertRaisesRegexp(Exception, '-T can not be selected with --table-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter5(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables = 'foo'
        options.exclude_dump_tables = 'foo'
        with self.assertRaisesRegexp(Exception, '-t can not be selected with -T option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_options_table_filter6(self, mock, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_dump_tables_file = 'foo'
        options.exclude_dump_tables_file = 'foo'
        with self.assertRaisesRegexp(Exception, '--table-file can not be selected with --exclude-table-file option'):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_timestamp_object1(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = '20130101010101'
        gpcd = GpCronDump(options, None)
        timestamp = gpcd._get_timestamp_object(options.timestamp_key)
        self.assertEquals(timestamp, datetime(2013, 1, 1, 1, 1, 1))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_timestamp_object2(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = '20130101010'
        gpcd = GpCronDump(options, None)
        with self.assertRaisesRegexp(Exception, 'Invalid timestamp key'):
            gpcd._get_timestamp_object(options.timestamp_key)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_timestamp_object3(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        gpcd = GpCronDump(options, None)
        timestamp = gpcd._get_timestamp_object(options.timestamp_key)
        self.assertTrue(isinstance(timestamp, datetime))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_files_file_list1(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.masterDataDirectory = '/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        files_file_list = gpcd._get_files_file_list(master, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/gp_cdatabase_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_ao_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_co_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_last_operation' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101.rpt' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_status_1_1_20130101010101' % options.masterDataDirectory]
        self.assertEqual(files_file_list, expected_files_list)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_files_file_list2(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.masterDataDirectory = '/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo2'
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        files_file_list = gpcd._get_files_file_list(master, dump_dir, timestamp)
        expected_files_list = ['foo2:%s/db_dumps/20130101/gp_cdatabase_1_1_20130101010101' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_20130101010101_ao_state_file' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_20130101010101_co_state_file' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_20130101010101_last_operation' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_20130101010101.rpt' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_status_1_1_20130101010101' % options.masterDataDirectory]
        self.assertEqual(files_file_list, expected_files_list)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_latest_full_dump_timestamp', return_value='20130101000000')
    def test_get_files_file_list3(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = '20130101010101'
        options.incremental = True
        options.masterDataDirectory = '/data/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        timestamp = '20130101010101'

        dump_dir = get_backup_directory(options.masterDataDirectory, None, gpcd.dump_dir, timestamp)
        files_file_list = gpcd._get_files_file_list(master, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/gp_cdatabase_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_ao_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_co_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101_last_operation' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101010101.rpt' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_status_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_20130101000000_increments' % options.masterDataDirectory]
        self.assertEqual(sorted(files_file_list), sorted(expected_files_list))

    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gppylib.operations.backup_utils.get_latest_full_dump_timestamp', return_value='20130101000000')
    def test_get_files_file_list_with_filter(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = '20130101010101'
        options.local_dump_prefix = 'metro'
        options.include_dump_tables_file = 'bar'
        options.masterDataDirectory = '/data/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        files_file_list = gpcd._get_files_file_list(master, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/metro_gp_cdatabase_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_ao_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_co_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_last_operation' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101.rpt' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_status_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_filter' % options.masterDataDirectory]
        self.assertEqual(sorted(files_file_list), sorted(expected_files_list))

    @patch('gpcrondump.validate_current_timestamp')
    @patch('gpcrondump.get_latest_full_dump_timestamp', return_value='20130101000000')
    @patch('gpcrondump.GpCronDump._get_master_port')
    def test_get_files_file_list_with_prefix(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = '20130101010101'
        options.incremental = True
        options.local_dump_prefix = 'metro'
        options.masterDataDirectory = '/data/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        timestamp = '20130101010101'

        dump_dir = get_backup_directory(options.masterDataDirectory, None, gpcd.dump_dir, timestamp)
        files_file_list = gpcd._get_files_file_list(master, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/metro_gp_cdatabase_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_ao_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_co_state_file' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101_last_operation' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101010101.rpt' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_status_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/metro_gp_dump_20130101000000_increments' % options.masterDataDirectory]

        self.assertEqual(sorted(files_file_list), sorted(expected_files_list))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_pipes_file_list1(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.masterDataDirectory = '/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo2'
        mock_segs = []
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        pipes_file_list = gpcd._get_pipes_file_list(master, mock_segs, dump_dir, timestamp)
        expected_files_list = ['foo2:%s/db_dumps/20130101/gp_dump_1_1_20130101010101.gz' % options.masterDataDirectory,
                               'foo2:%s/db_dumps/20130101/gp_dump_1_1_20130101010101_post_data.gz' % options.masterDataDirectory]
        self.assertEqual(pipes_file_list, expected_files_list)

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_pipes_file_list2(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.masterDataDirectory = '/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        mock_segs = [Mock(), Mock()]
        for id, seg in enumerate(mock_segs):
            seg.getSegmentDataDirectory.return_value = '/bar'
            seg.getSegmentHostName.return_value = 'foo1'
            seg.getSegmentDbId.return_value = id + 1
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        pipes_file_list = gpcd._get_pipes_file_list(master, mock_segs, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101.gz' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101_post_data.gz' % options.masterDataDirectory,
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_1_20130101010101.gz',
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_2_20130101010101.gz']
        self.assertEqual(sorted(pipes_file_list), sorted(expected_files_list))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_pipes_file_list3(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.dump_global = True
        options.masterDataDirectory = '/foo'
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        mock_segs = [Mock(), Mock()]
        for id, seg in enumerate(mock_segs):
            seg.getSegmentDataDirectory.return_value = '/bar'
            seg.getSegmentHostName.return_value = 'foo1'
            seg.getSegmentDbId.return_value = id + 1
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        pipes_file_list = gpcd._get_pipes_file_list(master, mock_segs, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101.gz' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101_post_data.gz' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_global_1_1_20130101010101' % options.masterDataDirectory,
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_1_20130101010101.gz',
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_2_20130101010101.gz']
        self.assertEqual(sorted(pipes_file_list), sorted(expected_files_list))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_get_pipes_file_list4(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.masterDataDirectory = '/foo'
        options.dump_config = True
        gpcd = GpCronDump(options, None)
        master = Mock()
        master.getSegmentHostName.return_value = 'foo1'
        mock_segs = [Mock(), Mock()]
        for id, seg in enumerate(mock_segs):
            seg.getSegmentDataDirectory.return_value = '/bar'
            seg.getSegmentHostName.return_value = 'foo1'
            seg.getSegmentDbId.return_value = id + 1
        timestamp = '20130101010101'
        dump_dir = get_backup_directory(options.masterDataDirectory, options.backup_dir, gpcd.dump_dir, timestamp)
        pipes_file_list = gpcd._get_pipes_file_list(master, mock_segs, dump_dir, timestamp)
        expected_files_list = ['foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101.gz' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_dump_1_1_20130101010101_post_data.gz' % options.masterDataDirectory,
                               'foo1:%s/db_dumps/20130101/gp_master_config_files_20130101010101.tar' % options.masterDataDirectory,
                               'foo1:/bar/db_dumps/20130101/gp_segment_config_files_0_1_20130101010101.tar',
                               'foo1:/bar/db_dumps/20130101/gp_segment_config_files_0_2_20130101010101.tar',
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_1_20130101010101.gz',
                               'foo1:/bar/db_dumps/20130101/gp_dump_0_2_20130101010101.gz']
        self.assertEqual(sorted(pipes_file_list), sorted(expected_files_list))

    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.validate_current_timestamp')
    def test_gpcrondump_init0(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.timestamp_key = None
        options.local_dump_prefix = 'foo'
        options.ddboost = False
        options.ddboost_verify = False
        options.ddboost_config_remove = False
        options.ddboost_user = False
        options.ddboost_host = False
        options.max_streams = None
        options.list_backup_files = False
        gpcd = GpCronDump(options, None)
        self.assertEqual(gpcd.dump_prefix, 'foo_')

    @patch('gpcrondump.os.path.isfile', return_value=True)
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.os.path.getsize', return_value=111)
    @patch('gpcrondump.yaml.load', return_value={'EMAIL_DETAILS': [{'FROM': 'RRP_MPE2_DCA_1', 'DBNAME': 'testdb100', 'SUBJECT': "backup completed for Database 'testdb100'"}]})
    def test_validate_parse_email_File00(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc.yaml"
        m = mock.MagicMock()
        with patch('__builtin__.open', m, create=True):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.os.path.isfile', return_value=False)
    @patch('gpcrondump.GpCronDump._get_master_port')
    def test_validate_parse_email_File01(self, mock1, mock2):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc.yaml"
        with self.assertRaisesRegexp(Exception, "\'%s\' file does not exist." % options.include_email_file):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.os.path.isfile', return_value=True)
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.os.path.getsize', return_value=111)
    def test_validate_parse_email_File02(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc"
        with self.assertRaisesRegexp(Exception, "'%s' is not '.yaml' file. File containing email details should be '.yaml' file." %  options.include_email_file):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.os.path.isfile', return_value=True)
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.os.path.getsize', return_value=0)
    def test_validate_parse_email_File03(self, mock1, mock2, mock3):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc.yaml"
        with self.assertRaisesRegexp(Exception, "'%s' file is empty." % options.include_email_file):
            cron = GpCronDump(options, None)

    @patch('gpcrondump.os.path.isfile', return_value=True)
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.os.path.getsize', return_value=111)
    @patch('gpcrondump.yaml.load', return_value={'EMAIL_DETAILS': [{'FROM': 'RRP_MPE2_DCA_1', 'NAME': 'testdb100', 'SUBJECT': "backup completed for Database 'testdb100'"}]})
    def test_validate_parse_email_File04(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc.yaml"
        m = mock.MagicMock()
        with self.assertRaisesRegexp(Exception, "\'%s\' file is not formatted properly." % options.include_email_file):
            with patch('__builtin__.open', m, create=True):
                cron = GpCronDump(options, None)

    @patch('gpcrondump.os.path.isfile', return_value=True)
    @patch('gpcrondump.GpCronDump._get_master_port')
    @patch('gpcrondump.os.path.getsize', return_value=111)
    @patch('gpcrondump.yaml.load', return_value={'EMAIL_DETAILS': [{'FROM': 'RRP_MPE2_DCA_1', 'DBNAME': None, 'SUBJECT': "backup completed for Database 'testdb100'"}]})
    def test_validate_parse_email_File05(self, mock1, mock2, mock3, mock4):
        options = GpCronDumpTestCase.Options()
        options.include_email_file = "/tmp/abc.yaml"
        m = mock.MagicMock()
        with self.assertRaisesRegexp(Exception, "\'%s\' file is not formatted properly." % options.include_email_file):
            with patch('__builtin__.open', m, create=True):
                cron = GpCronDump(options, None)

    @patch('gpcrondump.MailDumpEvent')
    @patch('gpcrondump.GpCronDump._get_master_port')
    def test_send_email00(self, mock1, MailDumpEvent):
        options = GpCronDumpTestCase.Options()
        dump_database = 'testdb1'
        current_exit_status = 0
        time_start = '12:07:09'
        time_end = '12:08:18'
        cron = GpCronDump(options, None)
        cron._send_email(dump_database, current_exit_status, time_start, time_end)

#------------------------------- Mainline --------------------------------
if __name__ == '__main__':
    unittest.main()

[((62, 91), 'os.path.abspath', 'os.path.abspath', (['"""gpcrondump"""'], {}), "('gpcrondump')\n", (77, 91), False, 'import os\n'), ((105, 151), 'imp.load_source', 'imp.load_source', (['"""gpcrondump"""', 'gpcrondump_path'], {}), "('gpcrondump', gpcrondump_path)\n", (120, 151), False, 'import imp\n'), ((516, 543), 'gppylib.gplog.get_unittest_logger', 'gplog.get_unittest_logger', ([], {}), '()\n', (541, 543), False, 'from gppylib import gplog\n'), ((2933, 2980), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (2938, 2980), False, 'from mock import patch, Mock\n'), ((2986, 3037), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump.validate_dump_schema"""'], {}), "('gpcrondump.GpCronDump.validate_dump_schema')\n", (2991, 3037), False, 'from mock import patch, Mock\n'), ((3043, 3089), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (3048, 3089), False, 'from mock import patch, Mock\n'), ((3452, 3499), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (3457, 3499), False, 'from mock import patch, Mock\n'), ((3505, 3556), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump.validate_dump_schema"""'], {}), "('gpcrondump.GpCronDump.validate_dump_schema')\n", (3510, 3556), False, 'from mock import patch, Mock\n'), ((3562, 3608), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (3567, 3608), False, 'from mock import patch, Mock\n'), ((3979, 4026), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (3984, 4026), False, 'from mock import patch, Mock\n'), ((4032, 4078), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (4037, 4078), False, 'from mock import patch, Mock\n'), ((4419, 4466), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (4424, 4466), False, 'from mock import patch, Mock\n'), ((4472, 4518), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (4477, 4518), False, 'from mock import patch, Mock\n'), ((4851, 4898), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (4856, 4898), False, 'from mock import patch, Mock\n'), ((4904, 4950), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (4909, 4950), False, 'from mock import patch, Mock\n'), ((5300, 5347), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (5305, 5347), False, 'from mock import patch, Mock\n'), ((5353, 5399), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (5358, 5399), False, 'from mock import patch, Mock\n'), ((5741, 5788), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (5746, 5788), False, 'from mock import patch, Mock\n'), ((5794, 5840), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (5799, 5840), False, 'from mock import patch, Mock\n'), ((6166, 6213), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (6171, 6213), False, 'from mock import patch, Mock\n'), ((6219, 6265), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (6224, 6265), False, 'from mock import patch, Mock\n'), ((6623, 6670), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (6628, 6670), False, 'from mock import patch, Mock\n'), ((6676, 6722), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (6681, 6722), False, 'from mock import patch, Mock\n'), ((7072, 7119), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (7077, 7119), False, 'from mock import patch, Mock\n'), ((7125, 7171), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (7130, 7171), False, 'from mock import patch, Mock\n'), ((7541, 7588), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (7546, 7588), False, 'from mock import patch, Mock\n'), ((7594, 7640), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (7599, 7640), False, 'from mock import patch, Mock\n'), ((8039, 8086), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (8044, 8086), False, 'from mock import patch, Mock\n'), ((8092, 8138), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (8097, 8138), False, 'from mock import patch, Mock\n'), ((8537, 8584), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (8542, 8584), False, 'from mock import patch, Mock\n'), ((8590, 8636), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (8595, 8636), False, 'from mock import patch, Mock\n'), ((9027, 9074), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (9032, 9074), False, 'from mock import patch, Mock\n'), ((9080, 9126), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (9085, 9126), False, 'from mock import patch, Mock\n'), ((9517, 9564), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (9522, 9564), False, 'from mock import patch, Mock\n'), ((9570, 9616), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (9575, 9616), False, 'from mock import patch, Mock\n'), ((9988, 10035), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (9993, 10035), False, 'from mock import patch, Mock\n'), ((10041, 10087), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (10046, 10087), False, 'from mock import patch, Mock\n'), ((10459, 10506), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (10464, 10506), False, 'from mock import patch, Mock\n'), ((10512, 10558), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (10517, 10558), False, 'from mock import patch, Mock\n'), ((10938, 10985), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (10943, 10985), False, 'from mock import patch, Mock\n'), ((10991, 11037), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (10996, 11037), False, 'from mock import patch, Mock\n'), ((11417, 11464), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (11422, 11464), False, 'from mock import patch, Mock\n'), ((11470, 11516), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (11475, 11516), False, 'from mock import patch, Mock\n'), ((11882, 11929), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (11887, 11929), False, 'from mock import patch, Mock\n'), ((11935, 11981), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (11940, 11981), False, 'from mock import patch, Mock\n'), ((12347, 12394), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (12352, 12394), False, 'from mock import patch, Mock\n'), ((12400, 12446), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (12405, 12446), False, 'from mock import patch, Mock\n'), ((12804, 12851), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (12809, 12851), False, 'from mock import patch, Mock\n'), ((12857, 12903), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (12862, 12903), False, 'from mock import patch, Mock\n'), ((13261, 13308), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (13266, 13308), False, 'from mock import patch, Mock\n'), ((13314, 13360), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (13319, 13360), False, 'from mock import patch, Mock\n'), ((13699, 13746), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (13704, 13746), False, 'from mock import patch, Mock\n'), ((13752, 13798), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (13757, 13798), False, 'from mock import patch, Mock\n'), ((14137, 14184), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (14142, 14184), False, 'from mock import patch, Mock\n'), ((14190, 14236), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (14195, 14236), False, 'from mock import patch, Mock\n'), ((14583, 14630), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (14588, 14630), False, 'from mock import patch, Mock\n'), ((14636, 14682), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (14641, 14682), False, 'from mock import patch, Mock\n'), ((15029, 15076), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (15034, 15076), False, 'from mock import patch, Mock\n'), ((15082, 15128), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (15087, 15128), False, 'from mock import patch, Mock\n'), ((15451, 15498), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (15456, 15498), False, 'from mock import patch, Mock\n'), ((15504, 15550), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (15509, 15550), False, 'from mock import patch, Mock\n'), ((15881, 15928), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (15886, 15928), False, 'from mock import patch, Mock\n'), ((15934, 15980), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (15939, 15980), False, 'from mock import patch, Mock\n'), ((15986, 16076), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {'return_value': "['public', 'information_schema']"}), "('gpcrondump.get_lines_from_file', return_value=['public',\n    'information_schema'])\n", (15991, 16076), False, 'from mock import patch, Mock\n'), ((16408, 16455), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (16413, 16455), False, 'from mock import patch, Mock\n'), ((16461, 16507), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (16466, 16507), False, 'from mock import patch, Mock\n'), ((16513, 16603), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {'return_value': "['public', 'information_schema']"}), "('gpcrondump.get_lines_from_file', return_value=['public',\n    'information_schema'])\n", (16518, 16603), False, 'from mock import patch, Mock\n'), ((16935, 16982), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (16940, 16982), False, 'from mock import patch, Mock\n'), ((16988, 17034), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (16993, 17034), False, 'from mock import patch, Mock\n'), ((17386, 17433), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (17391, 17433), False, 'from mock import patch, Mock\n'), ((17439, 17485), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (17444, 17485), False, 'from mock import patch, Mock\n'), ((17850, 17897), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (17855, 17897), False, 'from mock import patch, Mock\n'), ((17903, 17949), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (17908, 17949), False, 'from mock import patch, Mock\n'), ((18447, 18494), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (18452, 18494), False, 'from mock import patch, Mock\n'), ((18500, 18546), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (18505, 18546), False, 'from mock import patch, Mock\n'), ((18552, 18644), 'mock.patch', 'patch', (['"""gpcrondump.get_include_schema_list_from_exclude_schema"""'], {'return_value': "['public']"}), "('gpcrondump.get_include_schema_list_from_exclude_schema',\n    return_value=['public'])\n", (18557, 18644), False, 'from mock import patch, Mock\n'), ((19145, 19192), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (19150, 19192), False, 'from mock import patch, Mock\n'), ((19198, 19244), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (19203, 19244), False, 'from mock import patch, Mock\n'), ((19250, 19342), 'mock.patch', 'patch', (['"""gpcrondump.get_include_schema_list_from_exclude_schema"""'], {'return_value': "['public']"}), "('gpcrondump.get_include_schema_list_from_exclude_schema',\n    return_value=['public'])\n", (19255, 19342), False, 'from mock import patch, Mock\n'), ((19716, 19763), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (19721, 19763), False, 'from mock import patch, Mock\n'), ((19769, 19815), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (19774, 19815), False, 'from mock import patch, Mock\n'), ((19821, 19885), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {'return_value': "['public']"}), "('gpcrondump.get_lines_from_file', return_value=['public'])\n", (19826, 19885), False, 'from mock import patch, Mock\n'), ((19891, 20000), 'mock.patch', 'patch', (['"""gpcrondump.get_user_table_list_for_schema"""'], {'return_value': "['public', 'table1', 'public', 'table2']"}), "('gpcrondump.get_user_table_list_for_schema', return_value=['public',\n    'table1', 'public', 'table2'])\n", (19896, 20000), False, 'from mock import patch, Mock\n'), ((20378, 20425), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (20383, 20425), False, 'from mock import patch, Mock\n'), ((20431, 20477), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (20436, 20477), False, 'from mock import patch, Mock\n'), ((20812, 20859), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (20817, 20859), False, 'from mock import patch, Mock\n'), ((20865, 20911), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (20870, 20911), False, 'from mock import patch, Mock\n'), ((21246, 21293), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (21251, 21293), False, 'from mock import patch, Mock\n'), ((21299, 21345), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (21304, 21345), False, 'from mock import patch, Mock\n'), ((21685, 21732), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (21690, 21732), False, 'from mock import patch, Mock\n'), ((21738, 21784), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (21743, 21784), False, 'from mock import patch, Mock\n'), ((22124, 22171), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (22129, 22171), False, 'from mock import patch, Mock\n'), ((22177, 22223), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (22182, 22223), False, 'from mock import patch, Mock\n'), ((22684, 22731), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (22689, 22731), False, 'from mock import patch, Mock\n'), ((22737, 22783), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (22742, 22783), False, 'from mock import patch, Mock\n'), ((22789, 22875), 'mock.patch', 'patch', (['"""gpcrondump.get_latest_full_dump_timestamp"""'], {'return_value': '"""20121225090000"""'}), "('gpcrondump.get_latest_full_dump_timestamp', return_value=\n    '20121225090000')\n", (22794, 22875), False, 'from mock import patch, Mock\n'), ((23120, 23167), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (23125, 23167), False, 'from mock import patch, Mock\n'), ((23173, 23219), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (23178, 23219), False, 'from mock import patch, Mock\n'), ((23558, 23644), 'mock.patch', 'patch', (['"""gpcrondump.get_latest_full_dump_timestamp"""'], {'return_value': '"""20120330090000"""'}), "('gpcrondump.get_latest_full_dump_timestamp', return_value=\n    '20120330090000')\n", (23563, 23644), False, 'from mock import patch, Mock\n'), ((23645, 23691), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (23650, 23691), False, 'from mock import patch, Mock\n'), ((23697, 23744), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (23702, 23744), False, 'from mock import patch, Mock\n'), ((24029, 24076), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (24034, 24076), False, 'from mock import patch, Mock\n'), ((24082, 24128), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (24087, 24128), False, 'from mock import patch, Mock\n'), ((24405, 24452), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (24410, 24452), False, 'from mock import patch, Mock\n'), ((24458, 24504), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (24463, 24504), False, 'from mock import patch, Mock\n'), ((24788, 24835), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (24793, 24835), False, 'from mock import patch, Mock\n'), ((24841, 24887), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (24846, 24887), False, 'from mock import patch, Mock\n'), ((25180, 25227), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (25185, 25227), False, 'from mock import patch, Mock\n'), ((25233, 25279), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (25238, 25279), False, 'from mock import patch, Mock\n'), ((25575, 25622), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (25580, 25622), False, 'from mock import patch, Mock\n'), ((25628, 25674), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (25633, 25674), False, 'from mock import patch, Mock\n'), ((25993, 26040), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (25998, 26040), False, 'from mock import patch, Mock\n'), ((26046, 26092), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (26051, 26092), False, 'from mock import patch, Mock\n'), ((26410, 26457), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (26415, 26457), False, 'from mock import patch, Mock\n'), ((26463, 26509), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (26468, 26509), False, 'from mock import patch, Mock\n'), ((26829, 26876), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (26834, 26876), False, 'from mock import patch, Mock\n'), ((26882, 26928), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (26887, 26928), False, 'from mock import patch, Mock\n'), ((27275, 27322), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (27280, 27322), False, 'from mock import patch, Mock\n'), ((27328, 27374), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (27333, 27374), False, 'from mock import patch, Mock\n'), ((27722, 27769), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (27727, 27769), False, 'from mock import patch, Mock\n'), ((27775, 27821), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (27780, 27821), False, 'from mock import patch, Mock\n'), ((28160, 28207), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (28165, 28207), False, 'from mock import patch, Mock\n'), ((28213, 28259), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (28218, 28259), False, 'from mock import patch, Mock\n'), ((28602, 28649), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (28607, 28649), False, 'from mock import patch, Mock\n'), ((28655, 28701), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (28660, 28701), False, 'from mock import patch, Mock\n'), ((29057, 29104), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (29062, 29104), False, 'from mock import patch, Mock\n'), ((29110, 29156), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (29115, 29156), False, 'from mock import patch, Mock\n'), ((29470, 29517), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (29475, 29517), False, 'from mock import patch, Mock\n'), ((29523, 29569), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (29528, 29569), False, 'from mock import patch, Mock\n'), ((29894, 29941), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (29899, 29941), False, 'from mock import patch, Mock\n'), ((29947, 29993), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (29952, 29993), False, 'from mock import patch, Mock\n'), ((30383, 30430), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (30388, 30430), False, 'from mock import patch, Mock\n'), ((30436, 30482), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (30441, 30482), False, 'from mock import patch, Mock\n'), ((30970, 31017), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (30975, 31017), False, 'from mock import patch, Mock\n'), ((31023, 31069), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (31028, 31069), False, 'from mock import patch, Mock\n'), ((31504, 31551), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (31509, 31551), False, 'from mock import patch, Mock\n'), ((31557, 31603), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (31562, 31603), False, 'from mock import patch, Mock\n'), ((31609, 31722), 'mock.patch', 'patch', (['"""gpcrondump.expand_partitions_and_populate_filter_file"""'], {'return_value': '"""/tmp/include_dump_tables_file"""'}), "('gpcrondump.expand_partitions_and_populate_filter_file', return_value\n    ='/tmp/include_dump_tables_file')\n", (31614, 31722), False, 'from mock import patch, Mock\n'), ((31723, 31808), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {'return_value': "['public.t1', 'public.t2']"}), "('gpcrondump.get_lines_from_file', return_value=['public.t1', 'public.t2']\n    )\n", (31728, 31808), False, 'from mock import patch, Mock\n'), ((32310, 32357), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (32315, 32357), False, 'from mock import patch, Mock\n'), ((32363, 32409), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (32368, 32409), False, 'from mock import patch, Mock\n'), ((32415, 32528), 'mock.patch', 'patch', (['"""gpcrondump.expand_partitions_and_populate_filter_file"""'], {'return_value': '"""/tmp/include_dump_tables_file"""'}), "('gpcrondump.expand_partitions_and_populate_filter_file', return_value\n    ='/tmp/include_dump_tables_file')\n", (32420, 32528), False, 'from mock import patch, Mock\n'), ((32529, 32568), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {}), "('gpcrondump.get_lines_from_file')\n", (32534, 32568), False, 'from mock import patch, Mock\n'), ((33093, 33140), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (33098, 33140), False, 'from mock import patch, Mock\n'), ((33146, 33192), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (33151, 33192), False, 'from mock import patch, Mock\n'), ((33198, 33284), 'mock.patch', 'patch', (['"""gpcrondump.get_latest_full_dump_timestamp"""'], {'return_value': '"""20121225090000"""'}), "('gpcrondump.get_latest_full_dump_timestamp', return_value=\n    '20121225090000')\n", (33203, 33284), False, 'from mock import patch, Mock\n'), ((33763, 33810), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (33768, 33810), False, 'from mock import patch, Mock\n'), ((33816, 33862), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (33821, 33862), False, 'from mock import patch, Mock\n'), ((33868, 33981), 'mock.patch', 'patch', (['"""gpcrondump.expand_partitions_and_populate_filter_file"""'], {'return_value': '"""/tmp/exclude_dump_tables_file"""'}), "('gpcrondump.expand_partitions_and_populate_filter_file', return_value\n    ='/tmp/exclude_dump_tables_file')\n", (33873, 33981), False, 'from mock import patch, Mock\n'), ((33982, 34067), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {'return_value': "['public.t1', 'public.t2']"}), "('gpcrondump.get_lines_from_file', return_value=['public.t1', 'public.t2']\n    )\n", (33987, 34067), False, 'from mock import patch, Mock\n'), ((34567, 34614), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (34572, 34614), False, 'from mock import patch, Mock\n'), ((34620, 34666), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (34625, 34666), False, 'from mock import patch, Mock\n'), ((34672, 34785), 'mock.patch', 'patch', (['"""gpcrondump.expand_partitions_and_populate_filter_file"""'], {'return_value': '"""/tmp/exclude_dump_tables_file"""'}), "('gpcrondump.expand_partitions_and_populate_filter_file', return_value\n    ='/tmp/exclude_dump_tables_file')\n", (34677, 34785), False, 'from mock import patch, Mock\n'), ((34786, 34825), 'mock.patch', 'patch', (['"""gpcrondump.get_lines_from_file"""'], {}), "('gpcrondump.get_lines_from_file')\n", (34791, 34825), False, 'from mock import patch, Mock\n'), ((35350, 35397), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (35355, 35397), False, 'from mock import patch, Mock\n'), ((35403, 35449), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (35408, 35449), False, 'from mock import patch, Mock\n'), ((35455, 35608), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_table_names_from_partition_list"""'], {'side_effect': "[['public.aot1', 'public.aot2'], ['public.cot1', 'public.cot2']]"}), "('gpcrondump.GpCronDump._get_table_names_from_partition_list',\n    side_effect=[['public.aot1', 'public.aot2'], ['public.cot1',\n    'public.cot2']])\n", (35460, 35608), False, 'from mock import patch, Mock\n'), ((36092, 36139), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (36097, 36139), False, 'from mock import patch, Mock\n'), ((36145, 36191), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (36150, 36191), False, 'from mock import patch, Mock\n'), ((36197, 36358), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_table_names_from_partition_list"""'], {'side_effect': "[['public.aot1:asd', 'public.aot2'], ['public.cot1', 'public.cot2:asd']]"}), "('gpcrondump.GpCronDump._get_table_names_from_partition_list',\n    side_effect=[['public.aot1:asd', 'public.aot2'], ['public.cot1',\n    'public.cot2:asd']])\n", (36202, 36358), False, 'from mock import patch, Mock\n'), ((36903, 36950), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (36908, 36950), False, 'from mock import patch, Mock\n'), ((36956, 37002), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (36961, 37002), False, 'from mock import patch, Mock\n'), ((37380, 37427), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (37385, 37427), False, 'from mock import patch, Mock\n'), ((37433, 37479), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (37438, 37479), False, 'from mock import patch, Mock\n'), ((37851, 37898), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (37856, 37898), False, 'from mock import patch, Mock\n'), ((37904, 37950), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (37909, 37950), False, 'from mock import patch, Mock\n'), ((38342, 38389), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (38347, 38389), False, 'from mock import patch, Mock\n'), ((38395, 38441), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (38400, 38441), False, 'from mock import patch, Mock\n'), ((38869, 38916), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (38874, 38916), False, 'from mock import patch, Mock\n'), ((38922, 38968), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (38927, 38968), False, 'from mock import patch, Mock\n'), ((39381, 39428), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (39386, 39428), False, 'from mock import patch, Mock\n'), ((39434, 39480), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (39439, 39480), False, 'from mock import patch, Mock\n'), ((39827, 39874), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (39832, 39874), False, 'from mock import patch, Mock\n'), ((39880, 39926), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (39885, 39926), False, 'from mock import patch, Mock\n'), ((40281, 40328), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (40286, 40328), False, 'from mock import patch, Mock\n'), ((40334, 40380), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (40339, 40380), False, 'from mock import patch, Mock\n'), ((40735, 40782), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (40740, 40782), False, 'from mock import patch, Mock\n'), ((40788, 40834), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (40793, 40834), False, 'from mock import patch, Mock\n'), ((41181, 41228), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (41186, 41228), False, 'from mock import patch, Mock\n'), ((41234, 41280), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (41239, 41280), False, 'from mock import patch, Mock\n'), ((41612, 41659), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (41617, 41659), False, 'from mock import patch, Mock\n'), ((41665, 41711), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (41670, 41711), False, 'from mock import patch, Mock\n'), ((42081, 42128), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (42086, 42128), False, 'from mock import patch, Mock\n'), ((42134, 42180), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (42139, 42180), False, 'from mock import patch, Mock\n'), ((42518, 42565), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (42523, 42565), False, 'from mock import patch, Mock\n'), ((42571, 42617), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (42576, 42617), False, 'from mock import patch, Mock\n'), ((42950, 42997), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (42955, 42997), False, 'from mock import patch, Mock\n'), ((43003, 43049), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (43008, 43049), False, 'from mock import patch, Mock\n'), ((43364, 43411), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (43369, 43411), False, 'from mock import patch, Mock\n'), ((43417, 43463), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (43422, 43463), False, 'from mock import patch, Mock\n'), ((44816, 44863), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (44821, 44863), False, 'from mock import patch, Mock\n'), ((44869, 44915), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (44874, 44915), False, 'from mock import patch, Mock\n'), ((46268, 46315), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (46273, 46315), False, 'from mock import patch, Mock\n'), ((46321, 46367), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (46326, 46367), False, 'from mock import patch, Mock\n'), ((46373, 46459), 'mock.patch', 'patch', (['"""gpcrondump.get_latest_full_dump_timestamp"""'], {'return_value': '"""20130101000000"""'}), "('gpcrondump.get_latest_full_dump_timestamp', return_value=\n    '20130101000000')\n", (46378, 46459), False, 'from mock import patch, Mock\n'), ((47993, 48039), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (47998, 48039), False, 'from mock import patch, Mock\n'), ((48045, 48092), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (48050, 48092), False, 'from mock import patch, Mock\n'), ((48098, 48204), 'mock.patch', 'patch', (['"""gppylib.operations.backup_utils.get_latest_full_dump_timestamp"""'], {'return_value': '"""20130101000000"""'}), "('gppylib.operations.backup_utils.get_latest_full_dump_timestamp',\n    return_value='20130101000000')\n", (48103, 48204), False, 'from mock import patch, Mock\n'), ((49859, 49905), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (49864, 49905), False, 'from mock import patch, Mock\n'), ((49911, 49997), 'mock.patch', 'patch', (['"""gpcrondump.get_latest_full_dump_timestamp"""'], {'return_value': '"""20130101000000"""'}), "('gpcrondump.get_latest_full_dump_timestamp', return_value=\n    '20130101000000')\n", (49916, 49997), False, 'from mock import patch, Mock\n'), ((49998, 50045), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (50003, 50045), False, 'from mock import patch, Mock\n'), ((51682, 51729), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (51687, 51729), False, 'from mock import patch, Mock\n'), ((51735, 51781), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (51740, 51781), False, 'from mock import patch, Mock\n'), ((52673, 52720), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (52678, 52720), False, 'from mock import patch, Mock\n'), ((52726, 52772), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (52731, 52772), False, 'from mock import patch, Mock\n'), ((54095, 54142), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (54100, 54142), False, 'from mock import patch, Mock\n'), ((54148, 54194), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (54153, 54194), False, 'from mock import patch, Mock\n'), ((55671, 55718), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (55676, 55718), False, 'from mock import patch, Mock\n'), ((55724, 55770), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (55729, 55770), False, 'from mock import patch, Mock\n'), ((57478, 57525), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (57483, 57525), False, 'from mock import patch, Mock\n'), ((57531, 57577), 'mock.patch', 'patch', (['"""gpcrondump.validate_current_timestamp"""'], {}), "('gpcrondump.validate_current_timestamp')\n", (57536, 57577), False, 'from mock import patch, Mock\n'), ((58121, 58174), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(True)'}), "('gpcrondump.os.path.isfile', return_value=True)\n", (58126, 58174), False, 'from mock import patch, Mock\n'), ((58180, 58227), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (58185, 58227), False, 'from mock import patch, Mock\n'), ((58233, 58286), 'mock.patch', 'patch', (['"""gpcrondump.os.path.getsize"""'], {'return_value': '(111)'}), "('gpcrondump.os.path.getsize', return_value=111)\n", (58238, 58286), False, 'from mock import patch, Mock\n'), ((58292, 58470), 'mock.patch', 'patch', (['"""gpcrondump.yaml.load"""'], {'return_value': '{\'EMAIL_DETAILS\': [{\'FROM\': \'RRP_MPE2_DCA_1\', \'DBNAME\': \'testdb100\',\n    \'SUBJECT\': "backup completed for Database \'testdb100\'"}]}'}), '(\'gpcrondump.yaml.load\', return_value={\'EMAIL_DETAILS\': [{\'FROM\':\n    \'RRP_MPE2_DCA_1\', \'DBNAME\': \'testdb100\', \'SUBJECT\':\n    "backup completed for Database \'testdb100\'"}]})\n', (58297, 58470), False, 'from mock import patch, Mock\n'), ((58775, 58829), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(False)'}), "('gpcrondump.os.path.isfile', return_value=False)\n", (58780, 58829), False, 'from mock import patch, Mock\n'), ((58835, 58882), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (58840, 58882), False, 'from mock import patch, Mock\n'), ((59205, 59258), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(True)'}), "('gpcrondump.os.path.isfile', return_value=True)\n", (59210, 59258), False, 'from mock import patch, Mock\n'), ((59264, 59311), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (59269, 59311), False, 'from mock import patch, Mock\n'), ((59317, 59370), 'mock.patch', 'patch', (['"""gpcrondump.os.path.getsize"""'], {'return_value': '(111)'}), "('gpcrondump.os.path.getsize', return_value=111)\n", (59322, 59370), False, 'from mock import patch, Mock\n'), ((59748, 59801), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(True)'}), "('gpcrondump.os.path.isfile', return_value=True)\n", (59753, 59801), False, 'from mock import patch, Mock\n'), ((59807, 59854), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (59812, 59854), False, 'from mock import patch, Mock\n'), ((59860, 59911), 'mock.patch', 'patch', (['"""gpcrondump.os.path.getsize"""'], {'return_value': '(0)'}), "('gpcrondump.os.path.getsize', return_value=0)\n", (59865, 59911), False, 'from mock import patch, Mock\n'), ((60233, 60286), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(True)'}), "('gpcrondump.os.path.isfile', return_value=True)\n", (60238, 60286), False, 'from mock import patch, Mock\n'), ((60292, 60339), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (60297, 60339), False, 'from mock import patch, Mock\n'), ((60345, 60398), 'mock.patch', 'patch', (['"""gpcrondump.os.path.getsize"""'], {'return_value': '(111)'}), "('gpcrondump.os.path.getsize', return_value=111)\n", (60350, 60398), False, 'from mock import patch, Mock\n'), ((60404, 60580), 'mock.patch', 'patch', (['"""gpcrondump.yaml.load"""'], {'return_value': '{\'EMAIL_DETAILS\': [{\'FROM\': \'RRP_MPE2_DCA_1\', \'NAME\': \'testdb100\',\n    \'SUBJECT\': "backup completed for Database \'testdb100\'"}]}'}), '(\'gpcrondump.yaml.load\', return_value={\'EMAIL_DETAILS\': [{\'FROM\':\n    \'RRP_MPE2_DCA_1\', \'NAME\': \'testdb100\', \'SUBJECT\':\n    "backup completed for Database \'testdb100\'"}]})\n', (60409, 60580), False, 'from mock import patch, Mock\n'), ((61013, 61066), 'mock.patch', 'patch', (['"""gpcrondump.os.path.isfile"""'], {'return_value': '(True)'}), "('gpcrondump.os.path.isfile', return_value=True)\n", (61018, 61066), False, 'from mock import patch, Mock\n'), ((61072, 61119), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (61077, 61119), False, 'from mock import patch, Mock\n'), ((61125, 61178), 'mock.patch', 'patch', (['"""gpcrondump.os.path.getsize"""'], {'return_value': '(111)'}), "('gpcrondump.os.path.getsize', return_value=111)\n", (61130, 61178), False, 'from mock import patch, Mock\n'), ((61184, 61355), 'mock.patch', 'patch', (['"""gpcrondump.yaml.load"""'], {'return_value': '{\'EMAIL_DETAILS\': [{\'FROM\': \'RRP_MPE2_DCA_1\', \'DBNAME\': None, \'SUBJECT\':\n    "backup completed for Database \'testdb100\'"}]}'}), '(\'gpcrondump.yaml.load\', return_value={\'EMAIL_DETAILS\': [{\'FROM\':\n    \'RRP_MPE2_DCA_1\', \'DBNAME\': None, \'SUBJECT\':\n    "backup completed for Database \'testdb100\'"}]})\n', (61189, 61355), False, 'from mock import patch, Mock\n'), ((61788, 61821), 'mock.patch', 'patch', (['"""gpcrondump.MailDumpEvent"""'], {}), "('gpcrondump.MailDumpEvent')\n", (61793, 61821), False, 'from mock import patch, Mock\n'), ((61827, 61874), 'mock.patch', 'patch', (['"""gpcrondump.GpCronDump._get_master_port"""'], {}), "('gpcrondump.GpCronDump._get_master_port')\n", (61832, 61874), False, 'from mock import patch, Mock\n'), ((62336, 62351), 'unittest2.main', 'unittest.main', ([], {}), '()\n', (62349, 62351), True, 'import unittest2 as unittest\n'), ((17207, 17232), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (17217, 17232), False, 'from gpcrondump import GpCronDump\n'), ((17648, 17673), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (17658, 17673), False, 'from gpcrondump import GpCronDump\n'), ((18113, 18156), 'gppylib.operations.backup_utils.write_lines_to_file', 'write_lines_to_file', (['"""/tmp/foo"""', "['public']"], {}), "('/tmp/foo', ['public'])\n", (18132, 18156), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((18172, 18197), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (18182, 18197), False, 'from gpcrondump import GpCronDump\n'), ((18379, 18405), 'os.path.exists', 'os.path.exists', (['"""/tmp/foo"""'], {}), "('/tmp/foo')\n", (18393, 18405), False, 'import os\n'), ((18811, 18854), 'gppylib.operations.backup_utils.write_lines_to_file', 'write_lines_to_file', (['"""/tmp/foo"""', "['public']"], {}), "('/tmp/foo', ['public'])\n", (18830, 18854), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((18870, 18895), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (18880, 18895), False, 'from gpcrondump import GpCronDump\n'), ((19077, 19103), 'os.path.exists', 'os.path.exists', (['"""/tmp/foo"""'], {}), "('/tmp/foo')\n", (19091, 19103), False, 'import os\n'), ((19514, 19539), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (19524, 19539), False, 'from gpcrondump import GpCronDump\n'), ((20132, 20157), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (20142, 20157), False, 'from gpcrondump import GpCronDump\n'), ((23018, 23043), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (23028, 23043), False, 'from gpcrondump import GpCronDump\n'), ((23997, 24022), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (24007, 24022), False, 'from gpcrondump import GpCronDump\n'), ((24373, 24398), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (24383, 24398), False, 'from gpcrondump import GpCronDump\n'), ((24756, 24781), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (24766, 24781), False, 'from gpcrondump import GpCronDump\n'), ((25082, 25107), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (25092, 25107), False, 'from gpcrondump import GpCronDump\n'), ((25471, 25496), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (25481, 25496), False, 'from gpcrondump import GpCronDump\n'), ((31258, 31283), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (31268, 31283), False, 'from gpcrondump import GpCronDump\n'), ((32066, 32091), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (32076, 32091), False, 'from gpcrondump import GpCronDump\n'), ((32849, 32874), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (32859, 32874), False, 'from gpcrondump import GpCronDump\n'), ((33510, 33535), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (33520, 33535), False, 'from gpcrondump import GpCronDump\n'), ((34323, 34348), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (34333, 34348), False, 'from gpcrondump import GpCronDump\n'), ((35106, 35131), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (35116, 35131), False, 'from gpcrondump import GpCronDump\n'), ((35727, 35752), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (35737, 35752), False, 'from gpcrondump import GpCronDump\n'), ((36481, 36506), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (36491, 36506), False, 'from gpcrondump import GpCronDump\n'), ((38577, 38602), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (38587, 38602), False, 'from gpcrondump import GpCronDump\n'), ((39104, 39129), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (39114, 39129), False, 'from gpcrondump import GpCronDump\n'), ((42348, 42373), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (42358, 42373), False, 'from gpcrondump import GpCronDump\n'), ((42782, 42807), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (42792, 42807), False, 'from gpcrondump import GpCronDump\n'), ((43205, 43230), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (43215, 43230), False, 'from gpcrondump import GpCronDump\n'), ((43663, 43688), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (43673, 43688), False, 'from gpcrondump import GpCronDump\n'), ((43706, 43712), 'mock.Mock', 'Mock', ([], {}), '()\n', (43710, 43712), False, 'from mock import patch, Mock\n'), ((43825, 43925), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (43845, 43925), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((45115, 45140), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (45125, 45140), False, 'from gpcrondump import GpCronDump\n'), ((45158, 45164), 'mock.Mock', 'Mock', ([], {}), '()\n', (45162, 45164), False, 'from mock import patch, Mock\n'), ((45277, 45377), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (45297, 45377), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((46713, 46738), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (46723, 46738), False, 'from gpcrondump import GpCronDump\n'), ((46756, 46762), 'mock.Mock', 'Mock', ([], {}), '()\n', (46760, 46762), False, 'from mock import patch, Mock\n'), ((46876, 46961), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'None', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, None, gpcd.dump_dir,\n    timestamp)\n', (46896, 46961), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((48528, 48553), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (48538, 48553), False, 'from gpcrondump import GpCronDump\n'), ((48571, 48577), 'mock.Mock', 'Mock', ([], {}), '()\n', (48575, 48577), False, 'from mock import patch, Mock\n'), ((48690, 48790), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (48710, 48790), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((50359, 50384), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (50369, 50384), False, 'from gpcrondump import GpCronDump\n'), ((50402, 50408), 'mock.Mock', 'Mock', ([], {}), '()\n', (50406, 50408), False, 'from mock import patch, Mock\n'), ((50522, 50607), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'None', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, None, gpcd.dump_dir,\n    timestamp)\n', (50542, 50607), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((51981, 52006), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (51991, 52006), False, 'from gpcrondump import GpCronDump\n'), ((52024, 52030), 'mock.Mock', 'Mock', ([], {}), '()\n', (52028, 52030), False, 'from mock import patch, Mock\n'), ((52166, 52266), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (52186, 52266), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((52972, 52997), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (52982, 52997), False, 'from gpcrondump import GpCronDump\n'), ((53015, 53021), 'mock.Mock', 'Mock', ([], {}), '()\n', (53019, 53021), False, 'from mock import patch, Mock\n'), ((53388, 53488), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (53408, 53488), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((54429, 54454), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (54439, 54454), False, 'from gpcrondump import GpCronDump\n'), ((54472, 54478), 'mock.Mock', 'Mock', ([], {}), '()\n', (54476, 54478), False, 'from mock import patch, Mock\n'), ((54845, 54945), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (54865, 54945), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((56005, 56030), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (56015, 56030), False, 'from gpcrondump import GpCronDump\n'), ((56048, 56054), 'mock.Mock', 'Mock', ([], {}), '()\n', (56052, 56054), False, 'from mock import patch, Mock\n'), ((56421, 56521), 'gppylib.operations.backup_utils.get_backup_directory', 'get_backup_directory', (['options.masterDataDirectory', 'options.backup_dir', 'gpcd.dump_dir', 'timestamp'], {}), '(options.masterDataDirectory, options.backup_dir, gpcd.\n    dump_dir, timestamp)\n', (56441, 56521), False, 'from gppylib.operations.backup_utils import get_backup_directory, write_lines_to_file\n'), ((58038, 58063), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (58048, 58063), False, 'from gpcrondump import GpCronDump\n'), ((58651, 58667), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (58665, 58667), False, 'import mock\n'), ((60761, 60777), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (60775, 60777), False, 'import mock\n'), ((61536, 61552), 'mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (61550, 61552), False, 'import mock\n'), ((62120, 62145), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (62130, 62145), False, 'from gpcrondump import GpCronDump\n'), ((3420, 3445), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (3430, 3445), False, 'from gpcrondump import GpCronDump\n'), ((3947, 3972), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (3957, 3972), False, 'from gpcrondump import GpCronDump\n'), ((4387, 4412), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (4397, 4412), False, 'from gpcrondump import GpCronDump\n'), ((4819, 4844), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (4829, 4844), False, 'from gpcrondump import GpCronDump\n'), ((5268, 5293), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (5278, 5293), False, 'from gpcrondump import GpCronDump\n'), ((5709, 5734), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (5719, 5734), False, 'from gpcrondump import GpCronDump\n'), ((6134, 6159), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (6144, 6159), False, 'from gpcrondump import GpCronDump\n'), ((6591, 6616), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (6601, 6616), False, 'from gpcrondump import GpCronDump\n'), ((7040, 7065), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (7050, 7065), False, 'from gpcrondump import GpCronDump\n'), ((7509, 7534), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (7519, 7534), False, 'from gpcrondump import GpCronDump\n'), ((8007, 8032), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (8017, 8032), False, 'from gpcrondump import GpCronDump\n'), ((8505, 8530), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (8515, 8530), False, 'from gpcrondump import GpCronDump\n'), ((8995, 9020), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (9005, 9020), False, 'from gpcrondump import GpCronDump\n'), ((9485, 9510), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (9495, 9510), False, 'from gpcrondump import GpCronDump\n'), ((9956, 9981), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (9966, 9981), False, 'from gpcrondump import GpCronDump\n'), ((10427, 10452), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (10437, 10452), False, 'from gpcrondump import GpCronDump\n'), ((10906, 10931), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (10916, 10931), False, 'from gpcrondump import GpCronDump\n'), ((11385, 11410), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (11395, 11410), False, 'from gpcrondump import GpCronDump\n'), ((11850, 11875), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (11860, 11875), False, 'from gpcrondump import GpCronDump\n'), ((12315, 12340), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (12325, 12340), False, 'from gpcrondump import GpCronDump\n'), ((12772, 12797), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (12782, 12797), False, 'from gpcrondump import GpCronDump\n'), ((13229, 13254), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (13239, 13254), False, 'from gpcrondump import GpCronDump\n'), ((13667, 13692), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (13677, 13692), False, 'from gpcrondump import GpCronDump\n'), ((14105, 14130), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (14115, 14130), False, 'from gpcrondump import GpCronDump\n'), ((14551, 14576), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (14561, 14576), False, 'from gpcrondump import GpCronDump\n'), ((14997, 15022), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (15007, 15022), False, 'from gpcrondump import GpCronDump\n'), ((15419, 15444), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (15429, 15444), False, 'from gpcrondump import GpCronDump\n'), ((15849, 15874), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (15859, 15874), False, 'from gpcrondump import GpCronDump\n'), ((16376, 16401), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (16386, 16401), False, 'from gpcrondump import GpCronDump\n'), ((16903, 16928), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (16913, 16928), False, 'from gpcrondump import GpCronDump\n'), ((18419, 18440), 'os.remove', 'os.remove', (['"""/tmp/foo"""'], {}), "('/tmp/foo')\n", (18428, 18440), False, 'import os\n'), ((19117, 19138), 'os.remove', 'os.remove', (['"""/tmp/foo"""'], {}), "('/tmp/foo')\n", (19126, 19138), False, 'import os\n'), ((20780, 20805), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (20790, 20805), False, 'from gpcrondump import GpCronDump\n'), ((21214, 21239), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (21224, 21239), False, 'from gpcrondump import GpCronDump\n'), ((21653, 21678), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (21663, 21678), False, 'from gpcrondump import GpCronDump\n'), ((22092, 22117), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (22102, 22117), False, 'from gpcrondump import GpCronDump\n'), ((23526, 23551), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (23536, 23551), False, 'from gpcrondump import GpCronDump\n'), ((25961, 25986), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (25971, 25986), False, 'from gpcrondump import GpCronDump\n'), ((26378, 26403), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (26388, 26403), False, 'from gpcrondump import GpCronDump\n'), ((26797, 26822), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (26807, 26822), False, 'from gpcrondump import GpCronDump\n'), ((27243, 27268), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (27253, 27268), False, 'from gpcrondump import GpCronDump\n'), ((27690, 27715), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (27700, 27715), False, 'from gpcrondump import GpCronDump\n'), ((28128, 28153), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (28138, 28153), False, 'from gpcrondump import GpCronDump\n'), ((28570, 28595), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (28580, 28595), False, 'from gpcrondump import GpCronDump\n'), ((29025, 29050), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (29035, 29050), False, 'from gpcrondump import GpCronDump\n'), ((29438, 29463), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (29448, 29463), False, 'from gpcrondump import GpCronDump\n'), ((29862, 29887), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (29872, 29887), False, 'from gpcrondump import GpCronDump\n'), ((30351, 30376), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (30361, 30376), False, 'from gpcrondump import GpCronDump\n'), ((30938, 30963), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (30948, 30963), False, 'from gpcrondump import GpCronDump\n'), ((37348, 37373), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (37358, 37373), False, 'from gpcrondump import GpCronDump\n'), ((37819, 37844), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (37829, 37844), False, 'from gpcrondump import GpCronDump\n'), ((38310, 38335), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (38320, 38335), False, 'from gpcrondump import GpCronDump\n'), ((39795, 39820), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (39805, 39820), False, 'from gpcrondump import GpCronDump\n'), ((40249, 40274), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (40259, 40274), False, 'from gpcrondump import GpCronDump\n'), ((40703, 40728), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (40713, 40728), False, 'from gpcrondump import GpCronDump\n'), ((41149, 41174), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (41159, 41174), False, 'from gpcrondump import GpCronDump\n'), ((41580, 41605), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (41590, 41605), False, 'from gpcrondump import GpCronDump\n'), ((42049, 42074), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (42059, 42074), False, 'from gpcrondump import GpCronDump\n'), ((42481, 42510), 'datetime.datetime', 'datetime', (['(2013)', '(1)', '(1)', '(1)', '(1)', '(1)'], {}), '(2013, 1, 1, 1, 1, 1)\n', (42489, 42510), False, 'from datetime import datetime\n'), ((53099, 53105), 'mock.Mock', 'Mock', ([], {}), '()\n', (53103, 53105), False, 'from mock import patch, Mock\n'), ((53107, 53113), 'mock.Mock', 'Mock', ([], {}), '()\n', (53111, 53113), False, 'from mock import patch, Mock\n'), ((54556, 54562), 'mock.Mock', 'Mock', ([], {}), '()\n', (54560, 54562), False, 'from mock import patch, Mock\n'), ((54564, 54570), 'mock.Mock', 'Mock', ([], {}), '()\n', (54568, 54570), False, 'from mock import patch, Mock\n'), ((56132, 56138), 'mock.Mock', 'Mock', ([], {}), '()\n', (56136, 56138), False, 'from mock import patch, Mock\n'), ((56140, 56146), 'mock.Mock', 'Mock', ([], {}), '()\n', (56144, 56146), False, 'from mock import patch, Mock\n'), ((58681, 58722), 'mock.patch', 'patch', (['"""__builtin__.open"""', 'm'], {'create': '(True)'}), "('__builtin__.open', m, create=True)\n", (58686, 58722), False, 'from mock import patch, Mock\n'), ((58743, 58768), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (58753, 58768), False, 'from gpcrondump import GpCronDump\n'), ((59173, 59198), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (59183, 59198), False, 'from gpcrondump import GpCronDump\n'), ((59716, 59741), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (59726, 59741), False, 'from gpcrondump import GpCronDump\n'), ((60201, 60226), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (60211, 60226), False, 'from gpcrondump import GpCronDump\n'), ((22588, 22613), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (22598, 22613), False, 'from gpcrondump import GpCronDump\n'), ((60915, 60956), 'mock.patch', 'patch', (['"""__builtin__.open"""', 'm'], {'create': '(True)'}), "('__builtin__.open', m, create=True)\n", (60920, 60956), False, 'from mock import patch, Mock\n'), ((60981, 61006), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (60991, 61006), False, 'from gpcrondump import GpCronDump\n'), ((61690, 61731), 'mock.patch', 'patch', (['"""__builtin__.open"""', 'm'], {'create': '(True)'}), "('__builtin__.open', m, create=True)\n", (61695, 61731), False, 'from mock import patch, Mock\n'), ((61756, 61781), 'gpcrondump.GpCronDump', 'GpCronDump', (['options', 'None'], {}), '(options, None)\n', (61766, 61781), False, 'from gpcrondump import GpCronDump\n')]