Пример #1
0
 def test_tr_summary__falls_back_to_id(self):
     """
     Verify that Provider1.tr_summary() falls back to job.id, if summary is
     not defined
     """
     job = JobDefinition({'id': 'id'})
     self.assertEqual(job.tr_summary(), 'id')
Пример #2
0
 def test_tr_summary__falls_back_to_id(self):
     """
     Verify that Provider1.tr_summary() falls back to job.id, if summary is
     not defined
     """
     job = JobDefinition({'id': 'id'})
     self.assertEqual(job.tr_summary(), 'id')
Пример #3
0
 def test_tr_summary(self):
     """
     Verify that Provider1.tr_summary() works as expected
     """
     job = JobDefinition(self._full_record.data)
     with mock.patch.object(job, "get_normalized_translated_data") as mgntd:
         retval = job.tr_summary()
     # Ensure that get_translated_data() was called
     mgntd.assert_called_once_with(job.summary)
     # Ensure tr_summary() returned its return value
     self.assertEqual(retval, mgntd())
Пример #4
0
 def test_tr_summary(self):
     """
     Verify that Provider1.tr_summary() works as expected
     """
     job = JobDefinition(self._full_record.data)
     with mock.patch.object(job, "get_normalized_translated_data") as mgntd:
         retval = job.tr_summary()
     # Ensure that get_translated_data() was called
     mgntd.assert_called_once_with(job.summary)
     # Ensure tr_summary() returned its return value
     self.assertEqual(retval, mgntd())