本文整理汇总了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)
示例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)
示例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)
示例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())
示例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)
示例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))
示例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)
示例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)
示例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))
示例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)
示例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)
示例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))
示例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))
示例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)
示例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()