def action_test(params): from nailgun.logger import logger from nailgun.unit_test import TestRunner logger.info("Running tests...") TestRunner.run() logger.info("Done")
from nailgun.settings import settings if params.action == "syncdb": logger.info("Syncing database...") from nailgun.db import syncdb syncdb() logger.info("Done") elif params.action == "dropdb": logger.info("Dropping database...") from nailgun.db import dropdb dropdb() logger.info("Done") elif params.action == "test": logger.info("Running tests...") from nailgun.unit_test import TestRunner TestRunner.run() logger.info("Done") elif params.action == "loaddata": logger.info("Uploading fixture...") from nailgun.fixtures import fixman with open(params.fixture, "r") as fileobj: fixman.upload_fixture(fileobj) logger.info("Done") elif params.action == "loaddefault": logger.info("Uploading fixture...") from nailgun.fixtures import fixman fixman.upload_fixtures() logger.info("Done") elif params.action == "dump_settings": sys.stdout.write(settings.dump()) elif params.action in ("run",):
from nailgun.settings import settings if params.action == "syncdb": logger.info("Syncing database...") from nailgun.db import syncdb syncdb() logger.info("Done") elif params.action == "dropdb": logger.info("Dropping database...") from nailgun.db import dropdb dropdb() logger.info("Done") elif params.action == "test": logger.info("Running tests...") from nailgun.unit_test import TestRunner TestRunner.run() logger.info("Done") elif params.action == "loaddata": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman with open(params.fixture, "r") as fileobj: fixman.upload_fixture(fileobj) logger.info("Done") elif params.action == "loaddefault": logger.info("Uploading fixture...") from nailgun.db.sqlalchemy import fixman fixman.upload_fixtures() logger.info("Done") elif params.action == "dump_settings": sys.stdout.write(settings.dump()) elif params.action in ("run", ):