コード例 #1
0
ファイル: test_content.py プロジェクト: jeremycline/pulp
    def test_get_content_source(self, mock_sources, mock_resp):
        """
        List all sources
        """
        source = mock.MagicMock()
        source.id = 'my-id'
        source.dict.return_value = {'source_id': 'my-id'}
        mock_sources.return_value = {'mock': source}

        request = mock.MagicMock()
        content_source_view = ContentSourceCollectionView()
        response = content_source_view.get(request)

        mock_resp.assert_called_once_with([{'source_id': 'my-id',
                                            '_href': '/v2/content/sources/my-id/'}])
        self.assertTrue(response is mock_resp.return_value)
コード例 #2
0
ファイル: test_content.py プロジェクト: zjhuntin/pulp
    def test_get_content_source(self, mock_sources, mock_resp):
        """
        List all sources
        """
        source = mock.MagicMock()
        source.id = 'my-id'
        source.dict.return_value = {'source_id': 'my-id'}
        mock_sources.return_value = {'mock': source}

        request = mock.MagicMock()
        content_source_view = ContentSourceCollectionView()
        response = content_source_view.get(request)

        mock_resp.assert_called_once_with([{'source_id': 'my-id',
                                            '_href': '/v2/content/sources/my-id/'}])
        self.assertTrue(response is mock_resp.return_value)
コード例 #3
0
ファイル: urls.py プロジェクト: credativ/pulp
     DeleteOrphansActionView.as_view(),
     name='content_actions_delete_orphans'),
 url(r'^v2/content/catalog/(?P<source_id>[^/]+)/$',
     CatalogResourceView.as_view(),
     name='content_catalog_resource'),
 url(r'^v2/content/orphans/$',
     OrphanCollectionView.as_view(),
     name='content_orphan_collection'),
 url(r'^v2/content/orphans/(?P<content_type>[^/]+)/$',
     OrphanTypeSubCollectionView.as_view(),
     name='content_orphan_type_subcollection'),
 url(r'^v2/content/orphans/(?P<content_type>[^/]+)/(?P<unit_id>[^/]+)/$',
     OrphanResourceView.as_view(),
     name='content_orphan_resource'),
 url(r'^v2/content/sources/$',
     ContentSourceCollectionView.as_view(),
     name='content_sources'),
 url(r'^v2/content/sources/action/(?P<action>[^/]+)/$',
     ContentSourceCollectionActionView.as_view(),
     name='content_sources_action'),
 url(r'^v2/content/sources/(?P<source_id>[^/]+)/action/(?P<action>[^/]+)/$',
     ContentSourceResourceActionView.as_view(),
     name='content_sources_resource_action'),
 url(r'^v2/content/sources/(?P<source_id>[^/]+)/$',
     ContentSourceResourceView.as_view(),
     name='content_sources_resource'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/$',
     ContentUnitsCollectionView.as_view(),
     name='content_units_collection'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/search/$',
     ContentUnitSearch.as_view(),
コード例 #4
0
ファイル: urls.py プロジェクト: BrnoPCmaniak/pulp
 url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)/bindings/$',
     ConsumerGroupBindingsView.as_view(), name='consumer_group_bind'),
 url(r'^v2/consumer_groups/(?P<consumer_group_id>[^/]+)' +
     r'/bindings/(?P<repo_id>[^/]+)/(?P<distributor_id>[^/]+)/$',
     ConsumerGroupBindingView.as_view(), name='consumer_group_unbind'),
 url(r'^v2/content/actions/delete_orphans/$', DeleteOrphansActionView.as_view(),
     name='content_actions_delete_orphans'),
 url(r'^v2/content/catalog/(?P<source_id>[^/]+)/$', CatalogResourceView.as_view(),
     name='content_catalog_resource'),
 url(r'^v2/content/orphans/$', OrphanCollectionView.as_view(), name='content_orphan_collection'),
 url(r'^v2/content/orphans/(?P<content_type>[^/]+)/$', OrphanTypeSubCollectionView.as_view(),
     name='content_orphan_type_subcollection'),
 url(r'^v2/content/orphans/(?P<content_type>[^/]+)/(?P<unit_id>[^/]+)/$',
     OrphanResourceView.as_view(), name='content_orphan_resource'),
 url(r'^v2/content/sources/$',
     ContentSourceCollectionView.as_view(),
     name='content_sources'),
 url(r'^v2/content/sources/action/(?P<action>[^/]+)/$',
     ContentSourceCollectionActionView.as_view(),
     name='content_sources_action'),
 url(r'^v2/content/sources/(?P<source_id>[^/]+)/action/(?P<action>[^/]+)/$',
     ContentSourceResourceActionView.as_view(), name='content_sources_resource_action'),
 url(r'^v2/content/sources/(?P<source_id>[^/]+)/$', ContentSourceResourceView.as_view(),
     name='content_sources_resource'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/$', ContentUnitsCollectionView.as_view(),
     name='content_units_collection'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/search/$', ContentUnitSearch.as_view(),
     name='content_unit_search'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/(?P<unit_id>[^/]+)/$',
     ContentUnitResourceView.as_view(), name='content_unit_resource'),
 url(r'^v2/content/units/(?P<type_id>[^/]+)/(?P<unit_id>[^/]+)/pulp_user_metadata/$',