Skip to content

Commit 154806b

Browse files
authoredOct 20, 2022
Merge pull request #33 from KhushbooMer/issue-32
added fix for issue
2 parents a5ac95c + b79f306 commit 154806b

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed
 

‎imagekitio/constants/defaults.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Default(enum.Enum):
99
QUERY_TRANSFORMATION_POSITION,
1010
]
1111
DEFAULT_TIMESTAMP = 9999999999
12-
SDK_VERSION = "python-3.0.0"
12+
SDK_VERSION = "python-3.0.1"
1313
TRANSFORMATION_PARAMETER = "tr"
1414
CHAIN_TRANSFORM_DELIMITER = ":"
1515
TRANSFORM_DELIMITER = ","

‎imagekitio/file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def list(self, options: ListAndSearchFileRequestOptions = None) -> ListFileResul
130130
url = "{}/v1/files".format(URL.API_BASE_URL)
131131
headers = self.request.create_headers()
132132
resp = self.request.request(
133-
method="GET", url=url, headers=headers, params=dumps(formatted_options)
133+
method="GET", url=url, headers=headers, params=formatted_options
134134
)
135135
if resp.status_code == 200:
136136
response = convert_to_list_response_object(resp, FileResult, ListFileResult)

‎setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setuptools.setup(
1010
name="imagekitio",
11-
version="3.0.0",
11+
version="3.0.1",
1212
description="Python wrapper for the ImageKit API",
1313
long_description=long_description,
1414
long_description_content_type="text/markdown",

‎tests/test_files_ops.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,7 @@ def test_list_files_succeeds_with_basic_request_tags_with_array(self) -> None:
500500
}]""",
501501
headers=headers,
502502
match=[
503-
matchers.query_string_matcher(
504-
"%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"
503+
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"
505504
)
506505
],
507506
)
@@ -550,7 +549,7 @@ def test_list_files_succeeds_with_basic_request_tags_with_array(self) -> None:
550549
],
551550
}
552551
self.assertEqual(
553-
"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",
552+
"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",
554553
responses.calls[0].request.url,
555554
)
556555
self.assertEqual(
@@ -606,8 +605,7 @@ def test_list_files_succeeds_with_basic_request(self) -> None:
606605
}]""",
607606
headers=headers,
608607
match=[
609-
matchers.query_string_matcher(
610-
"%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"
608+
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"
611609
)
612610
],
613611
)
@@ -656,7 +654,7 @@ def test_list_files_succeeds_with_basic_request(self) -> None:
656654
],
657655
}
658656
self.assertEqual(
659-
"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",
657+
"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",
660658
responses.calls[0].request.url,
661659
)
662660
self.assertEqual(
@@ -680,8 +678,7 @@ def test_list_files_fails_with_400_exception(self) -> None:
680678
"documentation for syntax specification.",
681679
"help": "For support kindly contact us at support@imagekit.io ."}""",
682680
match=[
683-
matchers.query_string_matcher(
684-
"%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"
681+
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"
685682
)
686683
],
687684
)

0 commit comments

Comments
 (0)
Please sign in to comment.