Skip to content

Commit

Permalink
Continuing the holy crusade to improve test coverage on main.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermechapiewski committed Aug 10, 2009
1 parent b9f45b0 commit 19567f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/main.py
Expand Up @@ -7,15 +7,13 @@ class Main(object):

def __init__(self, config=None, mysql=None, db_migrate=None):
self.cli = CLI()
self.config = config
self.config = config or {}

self.mysql = mysql
if self.mysql is None and not self.config.get("new_migration"):
self.mysql = MySQL(config)

self.db_migrate = db_migrate
if self.db_migrate is None:
self.db_migrate = SimpleDBMigrate(config)
self.db_migrate = db_migrate or SimpleDBMigrate(config)

def execute(self):
self.cli.msg("\nStarting DB migration...", "PINK")
Expand Down
2 changes: 1 addition & 1 deletion tests/main_test.py
Expand Up @@ -13,7 +13,7 @@ def setUp(self):
self.database_versions.append("20090211120002")
self.database_versions.append("20090211120003")
self.database_versions.append("20090212120000")

def test_it_should_create_migration_if_option_is_activated_by_the_user(self):
class MainMock(Main):
def create_migration(self):
Expand Down

0 comments on commit 19567f6

Please sign in to comment.