def test_get_images(self, mock): case_signal = CaseSignalFactory() oio_url = ( 'https://ref.tst.vng.cloud:443/drc/api/v1/objectinformatieobjecten?object={}' .format(case_signal.zrc_link)) eio_url = ( 'https://ref.tst.vng.cloud/drc/api/v1/enkelvoudiginformatieobjecten/' + '1239d6b1-194a-4052-85c5-8c2876428531') self.get_mock(mock, 'drc_openapi') self.get_mock(mock, 'drc_objectinformatieobject_list', url=oio_url) self.get_mock(mock, 'drc_enkelvoudiginformatieobject_read', url=eio_url) self.assertEqual(case_signal.get_images(), json.loads(self.drc_images))
def test_get_images_existing_cache(self): case_signal = CaseSignalFactory() case_signal.cache_images = 'Random' self.assertEqual(case_signal.get_images(), 'Random')
def test_get_images_connection_error(self, mock): case_signal = CaseSignalFactory() self.get_exception_mock(mock, 'drc_openapi', ConnectionError) self.assertIsNone(case_signal.get_images())