From 2bd6c95d19fda69504d5d06feaaf94083bc26d02 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 10 Dec 2023 15:38:56 +0800 Subject: [PATCH] add a test for SecretStr in the python client --- samples/openapi3/client/petstore/python/tests/test_model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/openapi3/client/petstore/python/tests/test_model.py b/samples/openapi3/client/petstore/python/tests/test_model.py index 646755b7f1dd..b06eeaa0831f 100644 --- a/samples/openapi3/client/petstore/python/tests/test_model.py +++ b/samples/openapi3/client/petstore/python/tests/test_model.py @@ -392,6 +392,9 @@ def test_valdiator(self): a.pattern_with_digits_and_delimiter = "image_123" self.assertEqual(a.pattern_with_digits_and_delimiter, "image_123") + # test sanitize for serializaation with SecretStr (format: password) + self.assertEquals(petstore_api.ApiClient().sanitize_for_serialization(a), {'byte': b'string', 'date': '2013-09-17', 'number': 123.45, 'password': 'testing09876', 'pattern_with_digits_and_delimiter': 'image_123'}) + def test_inline_enum_validator(self): self.pet = petstore_api.Pet(name="test name", photoUrls=["string"]) self.pet.id = 1