Beispiel #1
0
    def test_get_types_view(self, mock_factory, mock_resp):
        """
        Types View should return a list of objects representing each type.
        """
        mock_type = [{'id': 'mock_id'}]
        mock_plugin_manager = mock.MagicMock()
        mock_plugin_manager.types.return_value = mock_type
        mock_factory.plugin_manager.return_value = mock_plugin_manager
        request = mock.MagicMock()
        request.get_full_path.return_value = '/mock/path'

        types_view = TypesView()
        types_view.get(request)

        expected_content = [{'id': 'mock_id', '_href': '/mock/path/mock_id/'}]
        mock_resp.assert_called_once_with(expected_content)