Ejemplo n.º 1
0
    def setUpClass(cls):
        """Create required entities for publishing a repository group.

        Do the following:

        1. Create a repository group and add the repository created by super
           call.
        2. Creates some distributors. Each distributor is configured with a
           valid checksum type.
        """
        super(RepoGroupExportChecksumTypeTestCase, cls).setUpClass()
        body = gen_repo_group()
        body['repo_ids'] = [cls.repo['id']]
        cls.repo_group = api.Client(cls.cfg).post(
            REPOSITORY_GROUP_PATH, body).json()
        cls.resources.add(cls.repo_group['_href'])
        cls.distributors = [
            _create_distributor(
                cls.cfg,
                cls.repo_group['_href'],
                REPOSITORY_GROUP_EXPORT_DISTRIBUTOR,
                checksum_type
            )
            for checksum_type in ('md5', 'sha1', 'sha256')
        ]
Ejemplo n.º 2
0
 def setUpClass(cls):
     """Create, update, read and delete a repository group."""
     super(RepositoryGroupCrudTestCase, cls).setUpClass()
     client = api.Client(cls.cfg)
     cls.bodies = {
         'create': gen_repo_group(),
         'update': {'display_name': utils.uuid4()},
     }
     cls.responses = {}
     cls.responses['create'] = client.post(
         REPOSITORY_GROUP_PATH,
         cls.bodies['create'],
     )
     repo_href = cls.responses['create'].json()['_href']
     cls.responses['update'] = client.put(repo_href, cls.bodies['update'])
     cls.responses['read'] = client.get(repo_href, params={'details': True})
     cls.responses['delete'] = client.delete(repo_href)
Ejemplo n.º 3
0
 def setUpClass(cls):
     """Create, update, read and delete a repository group."""
     super(RepositoryGroupCrudTestCase, cls).setUpClass()
     client = api.Client(cls.cfg)
     cls.bodies = {
         'create': gen_repo_group(),
         'update': {
             'display_name': utils.uuid4()
         },
     }
     cls.responses = {}
     cls.responses['create'] = client.post(
         REPOSITORY_GROUP_PATH,
         cls.bodies['create'],
     )
     repo_href = cls.responses['create'].json()['_href']
     cls.responses['update'] = client.put(repo_href, cls.bodies['update'])
     cls.responses['read'] = client.get(repo_href, params={'details': True})
     cls.responses['delete'] = client.delete(repo_href)
Ejemplo n.º 4
0
    def setUpClass(cls):
        """Create required entities for publishing a repository group.

        Do the following:

        1. Create a repository group and add the repository created by super
           call.
        2. Creates some distributors. Each distributor is configured with a
           valid checksum type.
        """
        super(RepoGroupExportChecksumTypeTestCase, cls).setUpClass()
        body = gen_repo_group()
        body['repo_ids'] = [cls.repo['id']]
        cls.repo_group = api.Client(cls.cfg).post(REPOSITORY_GROUP_PATH,
                                                  body).json()
        cls.resources.add(cls.repo_group['_href'])
        cls.distributors = [
            _create_distributor(cls.cfg, cls.repo_group['_href'],
                                REPOSITORY_GROUP_EXPORT_DISTRIBUTOR,
                                checksum_type)
            for checksum_type in ('md5', 'sha1', 'sha256')
        ]