示例#1
0
文件: tests.py 项目: yan5lang/sentry
    def test_does_fire_jobs(self, check_project_alerts):
        project = self.create_project()

        check_alerts()

        check_project_alerts.delay.assert_any_call(project_id=project.id,
                                                   expires=120)
示例#2
0
    def test_does_fire_jobs(self, check_project_alerts):
        project = self.create_project()

        check_alerts()

        check_project_alerts.apply_async.assert_any_call(
            kwargs=dict(project_id=project.id),
            expires=120,
        )
示例#3
0
    def test_does_fire_jobs(self, check_project_alerts):
        project = self.create_project()

        check_alerts()

        check_project_alerts.delay.assert_any_call(
            project_id=project.id,
            expires=120
        )
示例#4
0
文件: tests.py 项目: zhchwolf/sentry
    def test_does_fire_jobs(self, check_project_alerts):
        project = self.create_project()

        check_alerts()

        check_project_alerts.apply_async.assert_any_call(
            kwargs=dict(project_id=project.id),
            expires=120,
        )
示例#5
0
文件: tests.py 项目: xssworm/sentry
    def test_does_fire_jobs(self, check_project_alerts):
        when = timezone.now()
        self.create_counts(when, 50, 5, normalize=False)

        with mock.patch('sentry.tasks.check_alerts.timezone.now') as now:
            now.return_value = when
            check_alerts()
            now.assert_called_once_with()

        check_project_alerts.delay.assert_called_once_with(
            project_id=self.project.id,
            when=when - timedelta(minutes=1),
            count=10,
            expires=120)
示例#6
0
文件: tests.py 项目: 755/sentry
    def test_does_fire_jobs(self, check_project_alerts):
        when = timezone.now()
        self.create_counts(when, 50, 5, normalize=False)

        with mock.patch('sentry.tasks.check_alerts.timezone.now') as now:
            now.return_value = when
            check_alerts()
            now.assert_called_once_with()

        check_project_alerts.delay.assert_called_once_with(
            project_id=self.project.id,
            when=when - timedelta(minutes=1),
            count=10,
            expires=120
        )