コード例 #1
0
ファイル: api_test.py プロジェクト: truthadjustr/h
    def test_it_returns_presented_annotation(self, presentation_service,
                                             pyramid_request):
        context = mock.Mock()

        result = views.read(context, pyramid_request)

        presentation_service.present.assert_called_once_with(context)

        assert result == presentation_service.present.return_value
コード例 #2
0
ファイル: api_test.py プロジェクト: gnott/h
    def test_it_returns_presented_annotation(self,
                                             presentation_service,
                                             pyramid_request):
        context = mock.Mock()

        result = views.read(context, pyramid_request)

        presentation_service.present.assert_called_once_with(context)

        assert result == presentation_service.present.return_value
コード例 #3
0
ファイル: api_test.py プロジェクト: st-fresh/h
    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()