Exemplo n.º 1
0
    def testCronNotificationIsParsedCorrectly(self):
        n = self.InitFromObj_(
            rdf_objects.UserNotification.Type.TYPE_CRON_JOB_APPROVAL_GRANTED,
            rdf_objects.ObjectReference(
                reference_type=rdf_objects.ObjectReference.Type.CRON_JOB,
                cron_job=rdf_objects.CronJobReference(cron_job_id="FooBar")))

        self.assertEqual(n.reference.type, "CRON")
        self.assertEqual(n.reference.cron.cron_job_urn, "aff4:/cron/FooBar")
Exemplo n.º 2
0
  def testCronJobNotificationIsShownAndClickable(self):
    notification.Notify(
        self.token.username,
        rdf_objects.UserNotification.Type.TYPE_CRON_JOB_APPROVAL_GRANTED,
        "Test CronJob notification",
        rdf_objects.ObjectReference(
            reference_type=rdf_objects.ObjectReference.Type.CRON_JOB,
            cron_job=rdf_objects.CronJobReference(cron_job_id="OSBreakDown")))

    self.Open("/")

    self.Click("css=button[id=notification_button]")
    self.Click("css=a:contains('Test CronJob notification')")

    self.WaitUntil(self.IsElementPresent,
                   "css=tr.row-selected td:contains('OSBreakDown')")
    self.WaitUntil(self.IsElementPresent, "css=dd:contains('OSBreakDown')")
Exemplo n.º 3
0
 def ObjectReference(self):
   return rdf_objects.ObjectReference(
       reference_type=rdf_objects.ObjectReference.Type.CRON_JOB,
       cron_job=rdf_objects.CronJobReference(
           cron_job_id=utils.SmartStr(self.cron_job_id)))