Пример #1
0
    def test_to_dict(self):
        """Test whether a JobResult object is converted to a dict"""

        result = JobResult('arthur-job-1234567890', 'mytask',
                           'mock_backend', 'category')

        expected = {
            'job_id': 'arthur-job-1234567890',
            'task_id': 'mytask'
        }

        d = result.to_dict()
        self.assertEqual(d, expected)
Пример #2
0
    def test_to_dict(self):
        """Test whether a JobResult object is converted to a dict"""

        result = JobResult('arthur-job-1234567890', 'mytask', 'mock_backend',
                           'category', 'ABCDEFGHIJK', 1344965413.0, 58)

        expected = {
            'job_id': 'arthur-job-1234567890',
            'task_id': 'mytask',
            'last_uuid': 'ABCDEFGHIJK',
            'max_date': 1344965413.0,
            'nitems': 58,
            'offset': None,
        }

        d = result.to_dict()
        self.assertEqual(d, expected)