def test_set_description_without_description_provided_but_with_para(self): para = Paragraph('description') content = Content(paragraph=para) Image._set_content(self.image_mock, content) Image._set_description(self.image_mock, '') self.assertEqual(self.image_mock.description, 'description')
def test_set_description_default_behavior(self): self.image_mock.content.para = None Image._set_description(self.image_mock, None) self.assertEqual(self.image_mock.description, '')
def test_set_description_with_description_provided(self): Image._set_description(self.image_mock, 'foo') self.assertEqual(self.image_mock.description, 'foo')