8000 test(urlbuilder): add more testcases to test creation of srcset · imgix/imgix-python@5d303e6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d303e6

Browse files
ashutoshkrrisluqven
authored andcommitted
test(urlbuilder): add more testcases to test creation of srcset
1 parent 51292c3 commit 5d303e6

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/test_srcset.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,25 @@ def test_create_srcset_100_to_108():
134134

135135

136136
def test_create_srcset_with_widths_and_disable_path_encoding_true():
137-
ub = imgix.UrlBuilder(
138-
DOMAIN, include_library_param=False, disable_path_encoding=True
137+
ub = imgix.UrlBuilder(DOMAIN, include_library_param=False)
138+
actual = ub.create_srcset(
139+
JPG_PATH_WITH_SPACE,
140+
widths=[100],
141+
options={"disable_path_encoding": True},
139142
)
140-
actual = ub.create_srcset(JPG_PATH_WITH_SPACE, widths=[100])
141143
expected = "https://testing.imgix.net/image 123.jpg?w=100 100w"
142144

143145
assert expected == actual
144146

145147

146148
def test_create_srcset_start_equals_stop_with_disable_path_encoding_true():
147-
ub = imgix.UrlBuilder(
148-
DOMAIN, include_library_param=False, disable_path_encoding=True
149+
ub = imgix.UrlBuilder(DOMAIN, include_library_param=False)
150+
actual = ub.create_srcset(
151+
JPG_PATH_WITH_SPACE,
152+
start=713,
153+
stop=713,
154+
options={"disable_path_encoding": True},
149155
)
150-
actual = ub.create_srcset(JPG_PATH_WITH_SPACE, start=713, stop=713)
151156
expected = "https://testing.imgix.net/image 123.jpg?w=713 713w"
152157

153158
assert expected == actual

0 commit comments

Comments
 (0)
0