# 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_tag.py
# def main():
# def convert_tag(old, new):
# def convert_tag_callback(oldtag, newtag, 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_tag
# -*- coding: utf-8 -*-



class RenameTagTest(T.TestCase, FakeDataMixin):

    @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_tag.py
# def main():
# def convert_tag(old, new):
# def convert_tag_callback(oldtag, newtag, success, db_results):
# def check_db_results(success, db_results):


# Path: pushmanager/tests/test_rename_tag.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_tag

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



class RenameTagTest(T.TestCase, FakeDataMixin):

    @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):