def setUpClass(cls): config = setup_config_with_mongodb(settings=cls.settings) config = setup_config_with_pywps(config) config = setup_config_with_celery(config) config = get_test_weaver_config(config) cls.process_store = setup_mongodb_processstore(config) # force reset cls.job_store = setup_mongodb_jobstore(config) cls.app = get_test_weaver_app(config=config, settings=cls.settings) cls.db = get_db(config) cls.config = config cls.settings.update(cls.config.registry.settings) # back propagate changes
def setUp(self): # rebuild clean db on each test self.job_store = setup_mongodb_jobstore(self.config) self.process_store = setup_mongodb_processstore(self.config) self.service_store = setup_mongodb_servicestore(self.config) self.user_admin_id = 100 self.user_editor1_id = 1 self.user_editor2_id = 2 self.process_public = WpsTestProcess(identifier="process-public") self.process_store.save_process(self.process_public) self.process_store.set_visibility(self.process_public.identifier, VISIBILITY_PUBLIC) self.process_private = WpsTestProcess(identifier="process-private") self.process_store.save_process(self.process_private) self.process_store.set_visibility(self.process_private.identifier, VISIBILITY_PRIVATE) self.process_unknown = "process-unknown" self.service_public = Service(name="service-public", url="http://localhost/wps/service-public", public=True) self.service_store.save_service(self.service_public) self.service_private = Service(name="service-private", url="http://localhost/wps/service-private", public=False) self.service_store.save_service(self.service_private) # create jobs accessible by index self.job_info = [] # type: List[Job] self.make_job(task_id="0000-0000-0000-0000", process=self.process_public.identifier, service=None, user_id=self.user_editor1_id, status=STATUS_SUCCEEDED, progress=100, access=VISIBILITY_PUBLIC) self.make_job(task_id="1111-1111-1111-1111", process=self.process_unknown, service=self.service_public.name, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=99, access=VISIBILITY_PUBLIC) self.make_job(task_id="2222-2222-2222-2222", process=self.process_private.identifier, service=None, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=55, access=VISIBILITY_PUBLIC) # same process as job 0, but private (ex: job ran with private process, then process made public afterwards) self.make_job(task_id="3333-3333-3333-3333", process=self.process_public.identifier, service=None, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=55, access=VISIBILITY_PRIVATE) # job ran by admin self.make_job(task_id="4444-4444-4444-4444", process=self.process_public.identifier, service=None, user_id=self.user_admin_id, status=STATUS_FAILED, progress=55, access=VISIBILITY_PRIVATE) # job public/private service/process combinations self.make_job(task_id="5555-5555-5555-5555", process=self.process_public.identifier, service=self.service_public.name, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=99, access=VISIBILITY_PUBLIC) self.make_job(task_id="6666-6666-6666-6666", process=self.process_private.identifier, service=self.service_public.name, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=99, access=VISIBILITY_PUBLIC) self.make_job(task_id="7777-7777-7777-7777", process=self.process_public.identifier, service=self.service_private.name, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=99, access=VISIBILITY_PUBLIC) self.make_job(task_id="8888-8888-8888-8888", process=self.process_private.identifier, service=self.service_private.name, user_id=self.user_editor1_id, status=STATUS_FAILED, progress=99, access=VISIBILITY_PUBLIC)
def setUp(self): # rebuild clean db on each test self.process_store = setup_mongodb_processstore(self.config) self.job_store = setup_mongodb_jobstore(self.config) self.remote_server = "local" self.process_remote_WPS1 = "process_remote_wps1" self.process_remote_WPS3 = "process_remote_wps3" self.process_public = WpsTestProcess(identifier="process_public") self.process_private = WpsTestProcess(identifier="process_private") self.process_store.save_process(self.process_public) self.process_store.save_process(self.process_private) self.process_store.set_visibility(self.process_public.identifier, VISIBILITY_PUBLIC) self.process_store.set_visibility(self.process_private.identifier, VISIBILITY_PRIVATE)
def setUp(self): # rebuild clean db on each test self.service_store = setup_mongodb_servicestore(self.config) self.process_store = setup_mongodb_processstore(self.config) self.job_store = setup_mongodb_jobstore(self.config) self.app_url = self.settings["weaver.url"]