示例#1
0
文件: views_test.py 项目: zermelozf/h
    def test_it_returns_presented_annotation(self, AnnotationJSONPresenter,
                                             links_service, pyramid_request):
        annotation = mock.Mock()
        presenter = mock.Mock()
        AnnotationJSONPresenter.return_value = presenter

        result = views.read(annotation, pyramid_request)

        AnnotationJSONPresenter.assert_called_once_with(
            annotation, links_service)
        assert result == presenter.asdict()
示例#2
0
    def test_it_returns_presented_annotation(self, AnnotationJSONPresenter,
                                             pyramid_request):
        context = mock.Mock()
        presenter = mock.Mock()
        AnnotationJSONPresenter.return_value = presenter

        result = views.read(context, pyramid_request)

        AnnotationJSONPresenter.assert_called_once_with(context)

        assert result == presenter.asdict()
示例#3
0
文件: views_test.py 项目: nlisgo/h
    def test_it_returns_presented_annotation(self,
                                             AnnotationJSONPresenter,
                                             links_service,
                                             pyramid_request):
        annotation = mock.Mock()
        presenter = mock.Mock()
        AnnotationJSONPresenter.return_value = presenter

        result = views.read(annotation, pyramid_request)

        AnnotationJSONPresenter.assert_called_once_with(annotation,
                                                        links_service)
        assert result == presenter.asdict()