def test_effective_principals_proxies_to_basic_auth( self, pyramid_request, check, BasicAuthAuthenticationPolicy): auth_policy = AuthClientPolicy() auth_policy.effective_principals(pyramid_request) BasicAuthAuthenticationPolicy.return_value.effective_principals.assert_called_once_with( pyramid_request)
def test_effective_principals_proxies_to_basic_auth( self, pyramid_request, check, BasicAuthAuthenticationPolicy ): auth_policy = AuthClientPolicy() auth_policy.effective_principals(pyramid_request) BasicAuthAuthenticationPolicy.return_value.effective_principals.assert_called_once_with( pyramid_request )
def test_effective_principals_returns_only_Everyone_if_callback_returns_None( self, pyramid_request, check): check.return_value = None policy = AuthClientPolicy(check=check) principals = policy.effective_principals(pyramid_request) assert principals == ["system.Everyone"]
def test_effective_principals_returns_list_containing_callback_return_value( self, pyramid_request, check): check.return_value = ["foople", "blueberry"] policy = AuthClientPolicy(check=check) principals = policy.effective_principals(pyramid_request) assert "foople" in principals assert "blueberry" in principals
def test_effective_principals_returns_only_Everyone_if_callback_returns_None( self, pyramid_request, check ): check.return_value = None policy = AuthClientPolicy(check=check) principals = policy.effective_principals(pyramid_request) assert principals == ["system.Everyone"]
def test_effective_principals_returns_list_containing_callback_return_value( self, pyramid_request, check ): check.return_value = ["foople", "blueberry"] policy = AuthClientPolicy(check=check) principals = policy.effective_principals(pyramid_request) assert "foople" in principals assert "blueberry" in principals