def test_update_app_images(self) -> None:
    app = AppDef(name='foo', roles=[Role(name='a', image='sha256:hasha'), Role(name='b', image='sha256:hashb'), Role(name='c', image='c')])
    want = AppDef(name='foo', roles=[Role(name='a', image='example.com/repo:hasha'), Role(name='b', image='example.com/repo:hashb'), Role(name='c', image='c')])
    with self.assertRaisesRegex(KeyError, 'image_repo'):
        DockerWorkspace()._update_app_images(app, {})
    images_to_push = DockerWorkspace()._update_app_images(app, {'image_repo': 'example.com/repo'})
    self.assertEqual(images_to_push, {'sha256:hasha': ('example.com/repo', 'hasha'), 'sha256:hashb': ('example.com/repo', 'hashb')})
    self.assertEqual(app, want)
def test_update_app_images(self) -> None:
    app = AppDef(name='foo', roles=[Role(name='a', image='sha256:hasha'), Role(name='b', image='sha256:hashb'), Role(name='c', image='c')])
    want = AppDef(name='foo', roles=[Role(name='a', image='example.com/repo:hasha'), Role(name='b', image='example.com/repo:hashb'), Role(name='c', image='c')])
    with self.assertRaisesRegex(KeyError, 'image_repo'):
        DockerWorkspace()._update_app_images(app, {})
    images_to_push = DockerWorkspace()._update_app_images(app, {'image_repo': 'example.com/repo'})
    self.assertEqual(images_to_push, {'sha256:hasha': ('example.com/repo', 'hasha'), 'sha256:hashb': ('example.com/repo', 'hashb')})
    self.assertEqual(app, want)