コード例 #1
0
ファイル: test_export.py プロジェクト: idahoan/pybossa
 def test_get_export_task_jobs(self):
     """Test JOB export task jobs works."""
     app = AppFactory.create()
     jobs = get_export_task_jobs()
     msg = "There should be only one job."
     assert len(jobs) == 1, len(jobs)
     job = jobs[0]
     msg = "The job should be for the same app.id"
     assert job['args'] == [app.id], msg
     msg = "The job should be enqueued in low priority."
     assert job['queue'] == 'low', msg
コード例 #2
0
ファイル: test_export.py プロジェクト: idahoan/pybossa
 def test_get_export_task_pro_jobs(self):
     """Test JOB export task jobs for pro users works."""
     user = UserFactory.create(pro=True)
     app = AppFactory.create(owner=user)
     jobs = get_export_task_jobs()
     msg = "There should be only one job."
     assert len(jobs) == 1, len(jobs)
     job = jobs[0]
     msg = "The job should be for the same app.id"
     assert job['args'] == [app.id], msg
     msg = "The job should be enqueued in high priority."
     assert job['queue'] == 'high', msg
コード例 #3
0
ファイル: test_export.py プロジェクト: pkdevbox/pybossa
    def test_get_export_task_jobs(self):
        """Test JOB export task jobs works."""
        project = ProjectFactory.create()
        jobs_generator = get_export_task_jobs(queue='low')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in low priority."
        assert job['queue'] == 'low', msg
コード例 #4
0
    def test_get_export_task_jobs(self):
        """Test JOB export task jobs works."""
        project = ProjectFactory.create()
        jobs_generator = get_export_task_jobs(queue='low')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in low priority."
        assert job['queue'] == 'low', msg
コード例 #5
0
ファイル: test_export.py プロジェクト: pkdevbox/pybossa
    def test_get_export_task_pro_jobs(self):
        """Test JOB export task jobs for pro users works."""
        user = UserFactory.create(pro=True)
        project = ProjectFactory.create(owner=user)
        jobs_generator = get_export_task_jobs(queue='high')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in high priority."
        assert job['queue'] == 'high', msg
コード例 #6
0
    def test_get_export_task_pro_jobs(self):
        """Test JOB export task jobs for pro users works."""
        user = UserFactory.create(pro=True)
        project = ProjectFactory.create(owner=user)
        jobs_generator = get_export_task_jobs(queue='high')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in high priority."
        assert job['queue'] == 'high', msg
コード例 #7
0
    def test_get_export_task_jobs_pro_disabled_high_queue(self):
        """Test JOB export task jobs returns non pro projects for high queue if
        updated exports is enabled for everyone."""
        user = UserFactory.create()
        project = ProjectFactory.create(owner=user)
        jobs_generator = get_export_task_jobs(queue='high')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in high priority."
        assert job['queue'] == 'high', msg
コード例 #8
0
ファイル: test_export.py プロジェクト: PyBossa/pybossa
    def test_get_export_task_jobs_pro_disabled_high_queue(self):
        """Test JOB export task jobs returns non pro projects for high queue if
        updated exports is enabled for everyone."""
        user = UserFactory.create()
        project = ProjectFactory.create(owner=user)
        jobs_generator = get_export_task_jobs(queue='high')
        jobs = []
        for job in jobs_generator:
            jobs.append(job)

        msg = "There should be only one job."
        assert len(jobs) == 1, len(jobs)
        job = jobs[0]
        msg = "The job should be for the same project.id"
        assert job['args'] == [project.id], msg
        msg = "The job should be enqueued in high priority."
        assert job['queue'] == 'high', msg