當前位置: 首頁>>代碼示例>>Python>>正文


Python models.ProjectStatus類代碼示例

本文整理匯總了Python中squad.core.models.ProjectStatus的典型用法代碼示例。如果您正苦於以下問題:Python ProjectStatus類的具體用法?Python ProjectStatus怎麽用?Python ProjectStatus使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ProjectStatus類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_status_of_second_build

    def test_status_of_second_build(self):
        build = self.create_build('1')
        status1 = ProjectStatus.create_or_update(build)

        build2 = self.create_build('2')
        status2 = ProjectStatus.create_or_update(build2)
        self.assertEqual(status1, status2.get_previous())
        self.assertEqual(build2, status2.build)
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_project_status.py

示例2: test_cache_test_run_counts_on_update

    def test_cache_test_run_counts_on_update(self):
        build = self.create_build('1', create_test_run=False)
        ProjectStatus.create_or_update(build)

        build.test_runs.create(environment=self.environment, completed=True)
        build.test_runs.create(environment=self.environment, completed=False)
        status = ProjectStatus.create_or_update(build)
        self.assertEqual(2, status.test_runs_total)
        self.assertEqual(1, status.test_runs_completed)
        self.assertEqual(1, status.test_runs_incomplete)
開發者ID:Linaro,項目名稱:squad,代碼行數:10,代碼來源:test_project_status.py

示例3: test_updates_last_updated

    def test_updates_last_updated(self):
        build = self.create_build('1', datetime=h(10))
        test_run1 = build.test_runs.first()
        test_run1.tests.create(name='foo', suite=self.suite, result=True)
        status = ProjectStatus.create_or_update(build)
        old_date = status.last_updated

        build.test_runs.create(environment=self.environment)
        status = ProjectStatus.create_or_update(build)

        self.assertNotEqual(status.last_updated, old_date)
開發者ID:Linaro,項目名稱:squad,代碼行數:11,代碼來源:test_project_status.py

示例4: test_previous_must_be_from_the_same_project

    def test_previous_must_be_from_the_same_project(self):
        previous_build = self.create_build('1', datetime=h(10))
        previous = ProjectStatus.create_or_update(previous_build)

        other_project = self.group.projects.create(slug='other_project')
        other_env = other_project.environments.create(slug='other_env')
        other_build = other_project.builds.create(version='1', datetime=h(5))
        other_build.test_runs.create(environment=other_env)
        ProjectStatus.create_or_update(other_build)

        build = self.create_build('2', datetime=h(0))
        status = ProjectStatus.create_or_update(build)
        self.assertEqual(previous, status.get_previous())
開發者ID:Linaro,項目名稱:squad,代碼行數:13,代碼來源:test_project_status.py

示例5: test_cache_fixes

    def test_cache_fixes(self):
        build1 = self.create_build('1', datetime=h(10))
        test_run1 = build1.test_runs.first()
        test_run1.tests.create(name='foo', suite=self.suite, result=False)
        ProjectStatus.create_or_update(build1)

        build2 = self.create_build('2', datetime=h(9))
        test_run2 = build2.test_runs.first()
        test_run2.tests.create(name='foo', suite=self.suite, result=True)
        status = ProjectStatus.create_or_update(build2)

        self.assertIsNotNone(status.fixes)
        self.assertIsNone(status.regressions)
開發者ID:Linaro,項目名稱:squad,代碼行數:13,代碼來源:test_project_status.py

示例6: test_send_notification_for_all_builds

    def test_send_notification_for_all_builds(self, diff):
        self.project.subscriptions.create(email='[email protected]')
        diff.return_value = fake_diff()

        status1 = ProjectStatus.create_or_update(self.build2)
        send_status_notification(status1)
        self.assertEqual(1, len(mail.outbox))

        t = timezone.now() - relativedelta(hours=2.5)
        build = self.project.builds.create(version='3', datetime=t)
        status2 = ProjectStatus.create_or_update(build)
        send_status_notification(status2)

        self.assertEqual(2, len(mail.outbox))
開發者ID:Linaro,項目名稱:squad,代碼行數:14,代碼來源:test_notification.py

示例7: test_delegates_diff_to_test_comparison_object

    def test_delegates_diff_to_test_comparison_object(self, diff):
        the_diff = {}
        diff.return_value = the_diff

        group = Group.objects.create(slug='mygroup')
        project = group.projects.create(slug='myproject')
        build1 = project.builds.create(version='1')
        ProjectStatus.create_or_update(build1)
        build2 = project.builds.create(version='2')
        status = ProjectStatus.create_or_update(build2)

        notification = Notification(status)

        self.assertIs(the_diff, notification.diff)
開發者ID:Linaro,項目名稱:squad,代碼行數:14,代碼來源:test_notification.py

示例8: setUp

    def setUp(self):
        t0 = timezone.now() - relativedelta(hours=3)
        t = timezone.now() - relativedelta(hours=2.75)

        self.group = Group.objects.create(slug='mygroup')
        self.project = self.group.projects.create(slug='myproject')
        self.build1 = self.project.builds.create(version='1', datetime=t0)
        status = ProjectStatus.create_or_update(self.build1)
        status.notified = True
        status.save()
        self.build2 = self.project.builds.create(version='2', datetime=t)
        self.project.subscriptions.create(email='[email protected]')
        self.project.admin_subscriptions.create(email='[email protected]')
        self.project.moderate_notifications = True
        self.project.save()
        self.status = ProjectStatus.create_or_update(self.build2)
開發者ID:Linaro,項目名稱:squad,代碼行數:16,代碼來源:test_notification.py

示例9: test_send_notification_on_regression_only_with_no_regressions

 def test_send_notification_on_regression_only_with_no_regressions(self):
     self.project.subscriptions.create(
         email='[email protected]',
         notification_strategy=Subscription.NOTIFY_ON_REGRESSION)
     status = ProjectStatus.create_or_update(self.build2)
     send_status_notification(status)
     self.assertEqual(0, len(mail.outbox))
開發者ID:Linaro,項目名稱:squad,代碼行數:7,代碼來源:test_notification.py

示例10: test_zero_expected_test_runs

    def test_zero_expected_test_runs(self):
        self.project.environments.create(slug='other_env', expected_test_runs=0)

        build = self.create_build('1')

        status = ProjectStatus.create_or_update(build)
        self.assertTrue(status.finished)
開發者ID:Linaro,項目名稱:squad,代碼行數:7,代碼來源:test_project_status.py

示例11: test_maybe_notify_project_status

    def test_maybe_notify_project_status(self, send_status_notification):
        build = self.project1.builds.create(datetime=timezone.now())
        environment = self.project1.environments.create(slug='env')
        build.test_runs.create(environment=environment)
        status = ProjectStatus.create_or_update(build)

        maybe_notify_project_status(status.id)
        send_status_notification.assert_called_with(status)
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_tasks_notification.py

示例12: test_send_notification_on_change_only

 def test_send_notification_on_change_only(self, diff):
     diff.return_value = fake_diff()
     self.project.subscriptions.create(
         email='[email protected]',
         notification_strategy=Subscription.NOTIFY_ON_CHANGE)
     status = ProjectStatus.create_or_update(self.build2)
     send_status_notification(status)
     self.assertEqual(1, len(mail.outbox))
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_notification.py

示例13: test_send_notification_on_regression_only

 def test_send_notification_on_regression_only(self, regressions):
     regressions.return_value = OrderedDict({'key': 'value'})
     self.project.subscriptions.create(
         email='[email protected]',
         notification_strategy=Subscription.NOTIFY_ON_REGRESSION)
     status = ProjectStatus.create_or_update(self.build2)
     send_status_notification(status)
     self.assertEqual(1, len(mail.outbox))
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_notification.py

示例14: test_maybe_notify_project_status_notify_patch_build_finished

    def test_maybe_notify_project_status_notify_patch_build_finished(self, notify_patch_build_finished):
        build = self.project1.builds.create(datetime=timezone.now())
        environment = self.project1.environments.create(slug='env')
        build.test_runs.create(environment=environment)
        status = ProjectStatus.create_or_update(build)

        maybe_notify_project_status(status.id)
        notify_patch_build_finished.delay.assert_called_with(build.id)
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_tasks_notification.py

示例15: test_maybe_notify_project_status_schedule_timeout_not_requested

    def test_maybe_notify_project_status_schedule_timeout_not_requested(self, apply_async):
        build = self.project1.builds.create(datetime=timezone.now())
        environment = self.project1.environments.create(slug='env')
        build.test_runs.create(environment=environment)
        status = ProjectStatus.create_or_update(build)

        maybe_notify_project_status(status.id)
        apply_async.assert_not_called()
開發者ID:Linaro,項目名稱:squad,代碼行數:8,代碼來源:test_tasks_notification.py


注:本文中的squad.core.models.ProjectStatus類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。