Exemplo n.º 1
0
    def test_post_repo_group_publish_missing_distributor_id(self):
        """
        Test publishing a repo group without distributor_id in the params.
        """
        mock_request = mock.MagicMock()
        mock_request.body = json.dumps({'not_dist_id': 'mock'})

        repo_group_publish = RepoGroupPublishView()

        try:
            repo_group_publish.post(mock_request, 'group_id')
        except pulp_exceptions.MissingValue, response:
            pass
Exemplo n.º 2
0
 def test_post_repo_group_publish(self, mock_manager, mock_repo_group_publish, mock_tags):
     """
     Publish a repo group with all available params.
     """
     mock_request = mock.MagicMock()
     mock_request.body = json.dumps({'id': 'dist_id', 'override_config': 'mock_overrides'})
     mock_task_tags = [
         mock_tags.resource_tag(mock_tags.RESOURCE_REPOSITORY_GROUP_TYPE, 'group_id'),
         mock_tags.resource_tag(mock_tags.RESOURCE_REPOSITORY_GROUP_DISTRIBUTOR_TYPE, 'dist'),
         mock_tags.action_tag('publish')
     ]
     repo_group_publish = RepoGroupPublishView()
     try:
         repo_group_publish.post(mock_request, 'group_id')
     except pulp_exceptions.OperationPostponed, response:
         pass
Exemplo n.º 3
0
 url(r'^v2/plugins/distributors/$', DistributorsView.as_view(), name='plugin_distributors'),
 url(r'^v2/plugins/distributors/(?P<distributor_id>[^/]+)/$', DistributorResourceView.as_view(),
     name='plugin_distributor_resource'),
 url(r'^v2/plugins/importers/$', ImportersView.as_view(), name='plugin_importers'),
 url(r'^v2/plugins/importers/(?P<importer_id>[^/]+)/$', ImporterResourceView.as_view(),
     name='plugin_importer_resource'),
 url(r'^v2/plugins/types/$', TypesView.as_view(), name='plugin_types'),
 url(r'^v2/plugins/types/(?P<type_id>[^/]+)/$', TypeResourceView.as_view(),
     name='plugin_type_resource'),
 url(r'^v2/repo_groups/$', RepoGroupsView.as_view(), name='repo_groups'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/$', RepoGroupResourceView.as_view(),
     name='repo_group_resource'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/associate/$',
     RepoGroupAssociateView.as_view(), name='repo_group_associate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/publish/$',
     RepoGroupPublishView.as_view(), name='repo_group_publish'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/unassociate/$',
     RepoGroupUnassociateView.as_view(), name='repo_group_unassociate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/$',
     RepoGroupDistributorsView.as_view(), name='repo_group_distributors'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/(?P<distributor_id>[^/]+)/$',
     RepoGroupDistributorResourceView.as_view(), name='repo_group_distributor_resource'),
 url(r'^v2/repositories/$', ReposView.as_view(), name='repos'),
 url(r'^v2/repositories/actions/content/regenerate_applicability/$',
     ContentApplicabilityRegenerationView.as_view(), name='repo_content_app_regen'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/$', RepoResourceView.as_view(), name='repo_resource'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/importers/$', RepoImportersView.as_view(),
     name='repo_importers'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/importers/(?P<importer_id>[^/]+)/$',
     RepoImporterResourceView.as_view(), name='repo_importer_resource'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/importers/(?P<importer_id>[^/]+)/schedules/sync/$',
Exemplo n.º 4
0
 url(r'^v2/plugins/types/$', TypesView.as_view(), name='plugin_types'),
 url(r'^v2/plugins/types/(?P<type_id>[^/]+)/$',
     TypeResourceView.as_view(),
     name='plugin_type_resource'),
 url(r'^v2/repo_groups/$', RepoGroupsView.as_view(), name='repo_groups'),
 url(r'^v2/repo_groups/search/$',
     RepoGroupSearch.as_view(),
     name='repo_group_search'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/$',
     RepoGroupResourceView.as_view(),
     name='repo_group_resource'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/associate/$',
     RepoGroupAssociateView.as_view(),
     name='repo_group_associate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/publish/$',
     RepoGroupPublishView.as_view(),
     name='repo_group_publish'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/unassociate/$',
     RepoGroupUnassociateView.as_view(),
     name='repo_group_unassociate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/$',
     RepoGroupDistributorsView.as_view(),
     name='repo_group_distributors'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/(?P<distributor_id>[^/]+)/$',
     RepoGroupDistributorResourceView.as_view(),
     name='repo_group_distributor_resource'),
 url(r'^v2/repositories/$', ReposView.as_view(), name='repos'),
 url(r'^v2/repositories/search/$', RepoSearch.as_view(),
     name='repo_search'),
 url(r'^v2/repositories/actions/content/regenerate_applicability/$',
     ContentApplicabilityRegenerationView.as_view(),
Exemplo n.º 5
0
 url(r'^v2/plugins/distributors/(?P<distributor_id>[^/]+)/$', DistributorResourceView.as_view(),
     name='plugin_distributor_resource'),
 url(r'^v2/plugins/importers/$', ImportersView.as_view(), name='plugin_importers'),
 url(r'^v2/plugins/importers/(?P<importer_id>[^/]+)/$', ImporterResourceView.as_view(),
     name='plugin_importer_resource'),
 url(r'^v2/plugins/types/$', TypesView.as_view(), name='plugin_types'),
 url(r'^v2/plugins/types/(?P<type_id>[^/]+)/$', TypeResourceView.as_view(),
     name='plugin_type_resource'),
 url(r'^v2/repo_groups/$', RepoGroupsView.as_view(), name='repo_groups'),
 url(r'^v2/repo_groups/search/$', RepoGroupSearch.as_view(), name='repo_group_search'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/$', RepoGroupResourceView.as_view(),
     name='repo_group_resource'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/associate/$',
     RepoGroupAssociateView.as_view(), name='repo_group_associate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/publish/$',
     RepoGroupPublishView.as_view(), name='repo_group_publish'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/actions/unassociate/$',
     RepoGroupUnassociateView.as_view(), name='repo_group_unassociate'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/$',
     RepoGroupDistributorsView.as_view(), name='repo_group_distributors'),
 url(r'^v2/repo_groups/(?P<repo_group_id>[^/]+)/distributors/(?P<distributor_id>[^/]+)/$',
     RepoGroupDistributorResourceView.as_view(), name='repo_group_distributor_resource'),
 url(r'^v2/repositories/$', ReposView.as_view(), name='repos'),
 url(r'^v2/repositories/search/$', RepoSearch.as_view(), name='repo_search'),
 url(r'^v2/repositories/actions/content/regenerate_applicability/$',
     ContentApplicabilityRegenerationView.as_view(), name='repo_content_app_regen'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/$', RepoResourceView.as_view(), name='repo_resource'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/search/units/$', RepoUnitSearch.as_view(), name='repo_unit_search'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/importers/$', RepoImportersView.as_view(),
     name='repo_importers'),
 url(r'^v2/repositories/(?P<repo_id>[^/]+)/importers/(?P<importer_id>[^/]+)/$',