From fadb50c9ff7ecf2ef625f3ac8306505730ed726b Mon Sep 17 00:00:00 2001 From: Khush Date: Mon, 17 Oct 2022 11:53:15 +0530 Subject: [PATCH 1/3] added fix for issue --- imagekitio/file.py | 2 +- tests/test_files_ops.py | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/imagekitio/file.py b/imagekitio/file.py index 8a7741b..2d17921 100644 --- a/imagekitio/file.py +++ b/imagekitio/file.py @@ -130,7 +130,7 @@ def list(self, options: ListAndSearchFileRequestOptions = None) -> ListFileResul url = "{}/v1/files".format(URL.API_BASE_URL) headers = self.request.create_headers() resp = self.request.request( - method="GET", url=url, headers=headers, params=dumps(formatted_options) + method="GET", url=url, headers=headers, params=formatted_options ) if resp.status_code == 200: response = convert_to_list_response_object(resp, FileResult, ListFileResult) diff --git a/tests/test_files_ops.py b/tests/test_files_ops.py index 223b143..32f1d49 100644 --- a/tests/test_files_ops.py +++ b/tests/test_files_ops.py @@ -500,8 +500,7 @@ def test_list_files_succeeds_with_basic_request_tags_with_array(self) -> None: }]""", headers=headers, match=[ - matchers.query_string_matcher( - "%7B%22type%22:%20%22file%22,%20%22sort%22:%20%22ASC_CREATED%22,%20%22path%22:%20%22/%22,%20%22searchQuery%22:%20%22created_at%20%3E=%20'2d'%20OR%20size%20%3C%20'2mb'%20OR%20format='png'%22,%20%22fileType%22:%20%22all%22,%20%22limit%22:%201,%20%22skip%22:%200,%20%22tags%22:%20%22Tag-1,%20Tag-2,%20Tag-3%22%7D" + matchers.query_string_matcher("type=file&sort=ASC_CREATED&path=%2F&searchQuery=created_at+%3E%3D+%272d%27+OR+size+%3C+%272mb%27+OR+format%3D%27png%27&fileType=all&limit=1&skip=0&tags=Tag-1%2C+Tag-2%2C+Tag-3" ) ], ) @@ -550,7 +549,7 @@ def test_list_files_succeeds_with_basic_request_tags_with_array(self) -> None: ], } self.assertEqual( - "http://test.com/v1/files?%7B%22type%22:%20%22file%22,%20%22sort%22:%20%22ASC_CREATED%22,%20%22path%22:%20%22/%22,%20%22searchQuery%22:%20%22created_at%20%3E=%20'2d'%20OR%20size%20%3C%20'2mb'%20OR%20format='png'%22,%20%22fileType%22:%20%22all%22,%20%22limit%22:%201,%20%22skip%22:%200,%20%22tags%22:%20%22Tag-1,%20Tag-2,%20Tag-3%22%7D", + "http://test.com/v1/files?type=file&sort=ASC_CREATED&path=%2F&searchQuery=created_at+%3E%3D+%272d%27+OR+size+%3C+%272mb%27+OR+format%3D%27png%27&fileType=all&limit=1&skip=0&tags=Tag-1%2C+Tag-2%2C+Tag-3", responses.calls[0].request.url, ) self.assertEqual( @@ -606,8 +605,7 @@ def test_list_files_succeeds_with_basic_request(self) -> None: }]""", headers=headers, match=[ - matchers.query_string_matcher( - "%7B%22type%22:%20%22file%22,%20%22sort%22:%20%22ASC_CREATED%22,%20%22path%22:%20%22/%22,%20%22searchQuery%22:%20%22created_at%20%3E=%20'2d'%20OR%20size%20%3C%20'2mb'%20OR%20format='png'%22,%20%22fileType%22:%20%22all%22,%20%22limit%22:%201,%20%22skip%22:%200,%20%22tags%22:%20%22Tag-1,%20Tag-2,%20Tag-3%22%7D" + matchers.query_string_matcher("type=file&sort=ASC_CREATED&path=%2F&searchQuery=created_at+%3E%3D+%272d%27+OR+size+%3C+%272mb%27+OR+format%3D%27png%27&fileType=all&limit=1&skip=0&tags=Tag-1%2C+Tag-2%2C+Tag-3" ) ], ) @@ -656,7 +654,7 @@ def test_list_files_succeeds_with_basic_request(self) -> None: ], } self.assertEqual( - "http://test.com/v1/files?%7B%22type%22:%20%22file%22,%20%22sort%22:%20%22ASC_CREATED%22,%20%22path%22:%20%22/%22,%20%22searchQuery%22:%20%22created_at%20%3E=%20'2d'%20OR%20size%20%3C%20'2mb'%20OR%20format='png'%22,%20%22fileType%22:%20%22all%22,%20%22limit%22:%201,%20%22skip%22:%200,%20%22tags%22:%20%22Tag-1,%20Tag-2,%20Tag-3%22%7D", + "http://test.com/v1/files?type=file&sort=ASC_CREATED&path=%2F&searchQuery=created_at+%3E%3D+%272d%27+OR+size+%3C+%272mb%27+OR+format%3D%27png%27&fileType=all&limit=1&skip=0&tags=Tag-1%2C+Tag-2%2C+Tag-3", responses.calls[0].request.url, ) self.assertEqual( @@ -680,8 +678,7 @@ def test_list_files_fails_with_400_exception(self) -> None: "documentation for syntax specification.", "help": "For support kindly contact us at support@imagekit.io ."}""", match=[ - matchers.query_string_matcher( - "%7B%22type%22:%20%22file%22,%20%22sort%22:%20%22ASC_CREATED%22,%20%22path%22:%20%22/%22,%20%22searchQuery%22:%20%22created_at%20%3E=%20'2d'%20OR%20size%20%3C%20'2mb'%20OR%20format='png'%22,%20%22fileType%22:%20%22all%22,%20%22limit%22:%201,%20%22skip%22:%200,%20%22tags%22:%20%22Tag-1,%20Tag-2,%20Tag-3%22%7D" + matchers.query_string_matcher("type=file&sort=ASC_CREATED&path=%2F&searchQuery=created_at+%3E%3D+%272d%27+OR+size+%3C+%272mb%27+OR+format%3D%27png%27&fileType=all&limit=1&skip=0&tags=Tag-1%2C+Tag-2%2C+Tag-3" ) ], ) From 1ef945ff523e67dbeb02945d34e907b97ad007b5 Mon Sep 17 00:00:00 2001 From: Khush Date: Mon, 17 Oct 2022 12:17:32 +0530 Subject: [PATCH 2/3] bump the version --- README.md | 2 +- imagekitio/constants/defaults.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 98f52ba..71b62a9 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ This document presents a list of changes that break the existing functionality o ### Breaking History: -Changes from `2.2.8 -> 3.0.0` are listed below +Changes from `2.2.8 -> 3.0.1` are listed below 1. Throw an Error: diff --git a/imagekitio/constants/defaults.py b/imagekitio/constants/defaults.py index 9406acd..ffb51fb 100644 --- a/imagekitio/constants/defaults.py +++ b/imagekitio/constants/defaults.py @@ -9,7 +9,7 @@ class Default(enum.Enum): QUERY_TRANSFORMATION_POSITION, ] DEFAULT_TIMESTAMP = 9999999999 - SDK_VERSION = "python-3.0.0" + SDK_VERSION = "python-3.0.1" TRANSFORMATION_PARAMETER = "tr" CHAIN_TRANSFORM_DELIMITER = ":" TRANSFORM_DELIMITER = "," diff --git a/setup.py b/setup.py index 7bb8bd8..5146f5b 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="imagekitio", - version="3.0.0", + version="3.0.1", description="Python wrapper for the ImageKit API", long_description=long_description, long_description_content_type="text/markdown", From b79f3067fdf55649e136c4f74a8d5a839f55bc13 Mon Sep 17 00:00:00 2001 From: Khush Date: Mon, 17 Oct 2022 12:51:57 +0530 Subject: [PATCH 3/3] updated fix comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71b62a9..98f52ba 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ This document presents a list of changes that break the existing functionality o ### Breaking History: -Changes from `2.2.8 -> 3.0.1` are listed below +Changes from `2.2.8 -> 3.0.0` are listed below 1. Throw an Error: