Esempio n. 1
0
    def setup_class(cls):
        """Start container from image

        Scenario:
            1. Get image from private registry
            2. Start container with it
        """
        LOG.info("Up services")
        cli = docker.Client()
        project_name = cls.__name__
        services = []
        for s in cls.services:
            services.append(
                service.Service(
                    # name=s['name'],
                    project=project_name,
                    client=cli,
                    **s))
        cls.project = project.Project(name=project_name,
                                      services=services,
                                      client=cli)
        cls.containers = cls.project.up()
        wait_services = getattr(cls, 'wait_services', 5)
        LOG.info(
            "Sleep {} sec until MariDB is setting up".format(wait_services))
        time.sleep(wait_services)
        LOG.info("Start tests")
Esempio n. 2
0
def test_get_image_digest_no_image(mock_service):
    with pytest.raises(UserError) as exc:
        bundle.get_image_digest(service.Service(name='theservice'))

    assert "doesn't define an image tag" in exc.exconly()