예제 #1
0
    def setup(self,
              org_id,
              download_policy=DOWNLOAD_POLICY_ON_DEMAND,
              synchronize=True):
        # type: (int, str, bool) -> Tuple[Dict, List[Dict]]
        """Setup the repositories on server.

        Recommended usage: repository only setup, for full content setup see
            setup_content.
        """
        if self._repos_info:
            raise RepositoryAlreadyCreated('Repositories already created')
        custom_product = None
        repos_info = []
        if any(not repo.cdn for repo in self):
            custom_product = make_product_wait({'organization-id': org_id})
        custom_product_id = custom_product['id'] if custom_product else None
        for repo in self:
            repo_info = repo.create(org_id,
                                    custom_product_id,
                                    download_policy=download_policy,
                                    synchronize=synchronize)
            repos_info.append(repo_info)
        self._custom_product_info = custom_product
        self._repos_info = repos_info
        return custom_product, repos_info
예제 #2
0
    def setUpClass(cls):
        """Tests for logging to files"""
        super().setUpClass()

        # need own org for the manifest refresh test

        cls.org = make_org(cached=True)
        cls.product = make_product_wait({'organization-id': cls.org['id']})
예제 #3
0
    def setUp(self):
        """Tests for Repository via Hammer CLI"""

        super(RepositoryTestCase, self).setUp()

        if RepositoryTestCase.org is None:
            RepositoryTestCase.org = make_org(cached=True)
        if RepositoryTestCase.product is None:
            RepositoryTestCase.product = make_product_wait({u"organization-id": RepositoryTestCase.org["id"]})
예제 #4
0
    def setUp(self):
        """Tests for Repository via Hammer CLI"""

        super(RepositoryTestCase, self).setUp()

        if RepositoryTestCase.org is None:
            RepositoryTestCase.org = make_org(cached=True)
        if RepositoryTestCase.product is None:
            RepositoryTestCase.product = make_product_wait(
                {u'organization-id': RepositoryTestCase.org['id']}, )
 def setUpClass(cls):
     """Init single organization, product and repository for all tests"""
     super(ContentViewFilterTestCase, cls).setUpClass()
     cls.org = make_org()
     cls.product = make_product_wait({u'organization-id': cls.org['id']})
     cls.repo = make_repository({u'product-id': cls.product['id']})
     Repository.synchronize({u'id': cls.repo['id']})
     cls.content_view = make_content_view({
         u'organization-id': cls.org['id'],
     })
     ContentView.add_repository({
         u'id': cls.content_view['id'],
         u'repository-id': cls.repo['id'],
     })
예제 #6
0
 def setUpClass(cls):
     """Init single organization, product and repository for all tests"""
     super(ContentViewFilterTestCase, cls).setUpClass()
     cls.org = make_org()
     cls.product = make_product_wait({u'organization-id': cls.org['id']})
     cls.repo = make_repository({u'product-id': cls.product['id']})
     Repository.synchronize({u'id': cls.repo['id']})
     cls.content_view = make_content_view({
         u'organization-id': cls.org['id'],
     })
     ContentView.add_repository({
         u'id': cls.content_view['id'],
         u'repository-id': cls.repo['id'],
     })
 def setUpClass(cls):
     """Init single organization, product and repository for all tests"""
     super().setUpClass()
     cls.org = make_org()
     cls.product = make_product_wait({'organization-id': cls.org['id']})
     cls.content_view = make_content_view(
         {'organization-id': cls.org['id']})
     for _ in range(2):
         cls.repo = make_repository({'product-id': cls.product['id']})
         Repository.synchronize({'id': cls.repo['id']})
         ContentView.add_repository({
             'id': cls.content_view['id'],
             'repository-id': cls.repo['id']
         })
예제 #8
0
    def setup(self, org_id, download_policy=DOWNLOAD_POLICY_ON_DEMAND, synchronize=True):
        # type: (int, str, bool) -> Tuple[Dict, List[Dict]]
        """Setup the repositories on server.

        Recommended usage: repository only setup, for full content setup see
            setup_content.
        """
        if self._repos_info:
            raise RepositoryAlreadyCreated('Repositories already created')
        custom_product = None
        repos_info = []
        if any(not repo.cdn for repo in self):
            custom_product = make_product_wait({'organization-id': org_id})
        custom_product_id = custom_product['id'] if custom_product else None
        for repo in self:
            repo_info = repo.create(org_id, custom_product_id,
                                    download_policy=download_policy, synchronize=synchronize)
            repos_info.append(repo_info)
        self._custom_product_info = custom_product
        self._repos_info = repos_info
        return custom_product, repos_info