Allura/celeryconfig.py to ForgeGit/forgegit/tests/test_tasks.py
--- a/Allura/celeryconfig.py +++ b/ForgeGit/forgegit/tests/test_tasks.py @@ -1,19 +1,22 @@ -import sys -import pkg_resources +import unittest -print sys.argv +from ming.orm import ThreadLocalORMSession -BROKER_HOST = "localhost" -BROKER_PORT = 5672 -BROKER_USER = "testuser" -BROKER_PASSWORD = "testpw" -BROKER_VHOST = "testvhost" -CELERY_RESULT_BACKEND = "amqp" -ALLURA_CONFIG='config:/home/rick446/src/forge/Allura/development.ini#task' -CELERY_IMPORTS = ['allura'] +from alluratest.controller import setup_basic_test, setup_global_objects +from allura.lib import helpers as h +from allura.tasks import repo_tasks -visited = set() -for ep in pkg_resources.iter_entry_points('allura'): - visited.add(ep.module_name) -CELERY_IMPORTS += list(sorted(visited)) -print sorted(CELERY_IMPORTS) +class TestGitTasks(unittest.TestCase): + + def setUp(self): + setup_basic_test() + setup_global_objects() + h.set_context('test', 'src-git') + ThreadLocalORMSession.flush_all() + ThreadLocalORMSession.close_all() + + def test_init(self): + repo_tasks.init() + + def test_refresh_commit(self): + repo_tasks.refresh()
ForgeGit/forgegit/tests/test_reactors.py to ForgeHg/forgehg/tests/test_tasks.py
--- a/ForgeGit/forgegit/tests/test_reactors.py +++ b/ForgeHg/forgehg/tests/test_tasks.py @@ -6,24 +6,19 @@ from alluratest.controller import setup_basic_test, setup_global_objects from allura.lib import helpers as h +from allura.tasks import repo_tasks -from allura.lib.repository import RepositoryApp as R - -class TestGitReactors(unittest.TestCase): +class TestHgReactors(unittest.TestCase): def setUp(self): setup_basic_test() setup_global_objects() - h.set_context('test', 'src-git') + h.set_context('test', 'src-hg') ThreadLocalORMSession.flush_all() ThreadLocalORMSession.close_all() def test_init(self): - R._init('repo.init', dict( - project_id=str(c.project._id), - mount_point=c.app.config.options.mount_point)) + repo_tasks.init() def test_refresh_commit(self): - R._refresh('repo.refresh', dict( - project_id=str(c.project._id), - mount_point=c.app.config.options.mount_point)) + repo_tasks.refresh()