[18.0][ADD] webservice_client_certificate_auth: new module#123
[18.0][ADD] webservice_client_certificate_auth: new module#123vvrossem wants to merge 3 commits into
Conversation
9a9c865 to
2afcbb3
Compare
The test `test_oauth2_flow_compute_with_ui` iterates over all available `auth_type` values. When a module extends `webservice` with an additional `auth_type` (e.g., `client_certificate`), this test fails because it does not know how to populate the new required fields for that type. This commit restricts the test loop to the authentication types defined in `webservice` module.
| res = super()._setup_records() | ||
| cls.url = "https://localhost.demo.odoo/" | ||
| # Certificate and private key configuration | ||
| os.environ["SERVER_ENV_CONFIG"] = "\n".join( |
There was a problem hiding this comment.
this is the right way to mock env vars https://github.com/OCA/server-env/blob/18.0/server_environment/tests/test_server_environment.py#L59
There was a problem hiding this comment.
tests are updated to use load_config(): https://github.com/OCA/server-env/blob/18.0/server_environment/tests/common.py#L42-L63
| self.assertEqual(kwargs["cert"], ("/path/client.cert", "/path/client.key")) | ||
|
|
||
| def test_request_adapter_certificate_only(self): | ||
| with mock.patch("requests.request") as mock_request: |
There was a problem hiding this comment.
why not using responses lib? https://github.com/OCA/web-api/blob/18.0/webservice/tests/test_webservice.py#L82
There was a problem hiding this comment.
IIRC, I couldn't retrieve the request's kwargs using responses
f09340f to
0ab4d43
Compare
0ab4d43 to
42cc48d
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
|
This PR has the |
No description provided.