コード例 #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()