Example #1
0
    def test_subsecond_timestamp(self):
        # Add 2 events in <1s
        task = DummyTask()
        self.run_task(task)

        task_record = six.advance_iterator(self.history.find_all_by_name('DummyTask'))
        print(task_record.events)
        self.assertEqual(task_record.events[0].event_name, DONE)
Example #2
0
    def test_subsecond_timestamp(self):
        # Add 2 events in <1s
        task = DummyTask()
        self.run_task(task)

        task_record = six.advance_iterator(
            self.history.find_all_by_name('DummyTask'))
        print(task_record.events)
        self.assertEqual(task_record.events[0].event_name, DONE)
Example #3
0
    def test_utc_conversion(self):
        from luigi.server import from_utc

        task = DummyTask()
        self.run_task(task)

        task_record = six.advance_iterator(self.history.find_all_by_name('DummyTask'))
        last_event = task_record.events[0]
        try:
            print(from_utc(str(last_event.ts)))
        except ValueError:
            self.fail("Failed to convert timestamp {} to UTC".format(last_event.ts))
Example #4
0
    def test_utc_conversion(self):
        from luigi.server import from_utc

        task = DummyTask()
        self.run_task(task)

        task_record = six.advance_iterator(
            self.history.find_all_by_name('DummyTask'))
        last_event = task_record.events[0]
        try:
            print(from_utc(str(last_event.ts)))
        except ValueError:
            self.fail("Failed to convert timestamp {} to UTC".format(
                last_event.ts))