Beispiel #1
0
    def setUp(self):
        super(MySqlExporterTest, self).setUp()

        self.constants_mock = constants_mock.configure()
        modules = {"mysql_exporter_constants": self.constants_mock}
        self.patches = mock.patch.dict("sys.modules", modules)
        self.patches.start()

        import mysql_exporter
        self.mysql_exporter = mysql_exporter
  def setUp(self):
    super(CheckpointManangerTest, self).setUp()

    self.constants_mock = constants_mock.configure()
    modules = {"cloudsql_importer_constants": self.constants_mock}
    self.patches = mock.patch.dict("sys.modules", modules)
    self.patches.start()

    import checkpoint_manager
    self.checkpoint_manager = checkpoint_manager

    self.expected_checkpoint_for_function = {
        "force_drop_database":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "fail_if_database_exists":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "create_database":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "load_schema":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "create_temp_folder":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "generate_restore_secondary_indexes_commands":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "drop_secondary_indexes":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "chunk_data":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "load_data":
            checkpoint_manager._build_checkpoint_stage(
                "LOAD_DATA_CHECKPOINT", self.constants_mock.DATABASE_NAME,
                self.constants_mock.TEMP_FOLDER),
        "restore_secondary_indexes":
            checkpoint_manager._build_checkpoint_stage(
                "RESTORE_INDEX_CHECKPOINT", self.constants_mock.DATABASE_NAME,
                self.constants_mock.TEMP_FOLDER),
        "verify_checksum":
            checkpoint_manager._build_checkpoint_stage(
                "VERIFY_CHECKSUM_CHECKPOINT", self.constants_mock.DATABASE_NAME,
                self.constants_mock.TEMP_FOLDER),
        "drop_database":
            checkpoint_manager.NO_CHECKPOINT_STAGE,
        "cleanup":
            checkpoint_manager.NO_CHECKPOINT_STAGE
    }
Beispiel #3
0
 def setUp(self):
     super(SqlWrapperTest, self).setUp()
     self.constants_mock = constants_mock.configure()
Beispiel #4
0
 def setUp(self):
     super(ChunkerTest, self).setUp()
     self.constants_mock = constants_mock.configure()