コード例 #1
0
 def token_service(self, pyramid_config, pyramid_request):
     pyramid_config.registry.settings[
         'h.client_secret'] = 'notsosecretafterall'
     svc = mock.Mock(
         spec_set=auth_token_service_factory(None, pyramid_request))
     pyramid_config.register_service(svc, name='auth_token')
     return svc
コード例 #2
0
    def test_it_passes_session(self, pyramid_request, mocked_service):
        auth_token_service_factory(None, pyramid_request)

        mocked_service.assert_called_once_with(pyramid_request.db)
コード例 #3
0
    def test_it_returns_service(self, pyramid_request):
        result = auth_token_service_factory(None, pyramid_request)

        assert isinstance(result, AuthTokenService)
コード例 #4
0
ファイル: auth_token_test.py プロジェクト: gnott/h
    def test_it_passes_session(self, pyramid_request, mocked_service):
        auth_token_service_factory(None, pyramid_request)

        mocked_service.assert_called_once_with(pyramid_request.db, mock.ANY)
コード例 #5
0
ファイル: auth_token_test.py プロジェクト: gnott/h
    def test_it_returns_service(self, pyramid_request):
        result = auth_token_service_factory(None, pyramid_request)

        assert isinstance(result, AuthTokenService)
コード例 #6
0
ファイル: auth_token_test.py プロジェクト: gnott/h
    def test_it_passes_client_secret(self, pyramid_request, mocked_service):
        auth_token_service_factory(None, pyramid_request)

        mocked_service.assert_called_once_with(mock.ANY, 'the-secret')
コード例 #7
0
 def token_service(self, pyramid_config, pyramid_request):
     svc = mock.Mock(
         spec_set=auth_token_service_factory(None, pyramid_request))
     pyramid_config.register_service(svc, name="auth_token")
     return svc
コード例 #8
0
ファイル: auth_test.py プロジェクト: hypothesis/h
 def token_service(self, pyramid_config, pyramid_request):
     svc = mock.Mock(spec_set=auth_token_service_factory(None, pyramid_request))
     pyramid_config.register_service(svc, name="auth_token")
     return svc
コード例 #9
0
    def test_it_passes_client_secret(self, pyramid_request, mocked_service):
        auth_token_service_factory(None, pyramid_request)

        mocked_service.assert_called_once_with(mock.ANY, 'the-secret')