# Path: pushmanager/core/db.py
# def UnsignedInteger():
# def init_db():
# def finalize_db():
# def execute_cb(query, callback_fn):
# def execute_transaction_cb(queries, callback_fn, condition=None):
# def prefix_insert_ignore(insert_ignore, compiler, **kw):
# def prefix_insert_ignore_sqlite(insert_ignore, compiler, **kw):
# class DatabaseError(Exception):
# class PushCheckList(Base):
# class PushPlans(Base):
# class PushPushContents(Base):
# class PushPushes(Base):
# class PushRemovals(Base):
# class PushRequests(Base):
# class InsertIgnore(Insert):
# 
# Path: pushmanager/testing/mocksettings.py

# 
# Path: tools/rename_checklist_type.py
# def main():
# def convert_checklist(old, new):
# def convert_checklist_callback(old, new, success, db_results):
# def check_db_results(success, db_results):


import os
import testify as T
from functools import partial
from mock import patch
from pushmanager.core import db
from pushmanager.testing import testdb
from pushmanager.testing.mocksettings import MockedSettings
from pushmanager.testing.testdb import FakeDataMixin
from tools import rename_checklist_type
# -*- coding: utf-8 -*-



class RenameTagTest(T.TestCase, FakeDataMixin):

    checklist_keys = ['id', 'request', 'type', 'complete', 'target']

    checklist_data = [
        [1, 0, 'search', 0, 'stage'],
        [2, 0, 'search', 0, 'prod'],
        [3, 0, 'search-cleanup', 0, 'post-stage-verify'],
        [4, 0, 'pushplans', 0, 'stage'],
        [5, 0, 'pushplans-cleanup', 0, 'prod']
    ]

    @T.setup_teardown
    def setup_db(self):
        self.db_file_path = testdb.create_temp_db_file()
        MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path)

# Path: pushmanager/core/db.py
# def UnsignedInteger():
# def init_db():
# def finalize_db():
# def execute_cb(query, callback_fn):
# def execute_transaction_cb(queries, callback_fn, condition=None):
# def prefix_insert_ignore(insert_ignore, compiler, **kw):
# def prefix_insert_ignore_sqlite(insert_ignore, compiler, **kw):
# class DatabaseError(Exception):
# class PushCheckList(Base):
# class PushPlans(Base):
# class PushPushContents(Base):
# class PushPushes(Base):
# class PushRemovals(Base):
# class PushRequests(Base):
# class InsertIgnore(Insert):
# 
# Path: pushmanager/testing/mocksettings.py

# 
# Path: tools/rename_checklist_type.py
# def main():
# def convert_checklist(old, new):
# def convert_checklist_callback(old, new, success, db_results):
# def check_db_results(success, db_results):


# Path: pushmanager/tests/test_rename_checklist_type.py
import os
import testify as T
from functools import partial
from mock import patch
from pushmanager.core import db
from pushmanager.testing import testdb
from pushmanager.testing.mocksettings import MockedSettings
from pushmanager.testing.testdb import FakeDataMixin
from tools import rename_checklist_type

# -*- coding: utf-8 -*-



class RenameTagTest(T.TestCase, FakeDataMixin):

    checklist_keys = ['id', 'request', 'type', 'complete', 'target']

    checklist_data = [
        [1, 0, 'search', 0, 'stage'],
        [2, 0, 'search', 0, 'prod'],
        [3, 0, 'search-cleanup', 0, 'post-stage-verify'],
        [4, 0, 'pushplans', 0, 'stage'],
        [5, 0, 'pushplans-cleanup', 0, 'prod']
    ]

    @T.setup_teardown
    def setup_db(self):
        self.db_file_path = testdb.create_temp_db_file()
        MockedSettings['db_uri'] = testdb.get_temp_db_uri(self.db_file_path)

        with patch.dict(db.Settings, MockedSettings):