Skip to content

Commit 6419930

Browse files
committed
add tests
1 parent 0ea52e4 commit 6419930

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

python_files/tests/test_normalize_selection.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,3 +268,50 @@ def test_list_comp(self):
268268
result = normalizeSelection.normalize_lines(src)
269269

270270
assert result == expected
271+
272+
def test_return_dict(self):
273+
importlib.reload(normalizeSelection)
274+
src = textwrap.dedent(
275+
"""\
276+
def get_dog(name, breed):
277+
return {'name': name, 'breed': breed}
278+
"""
279+
)
280+
281+
expected = textwrap.dedent(
282+
"""\
283+
def get_dog(name, breed):
284+
return {'name': name, 'breed': breed}
285+
286+
"""
287+
)
288+
289+
result = normalizeSelection.normalize_lines(src)
290+
291+
assert result == expected
292+
293+
def test_return_dict2(self):
294+
importlib.reload(normalizeSelection)
295+
src = textwrap.dedent(
296+
"""\
297+
def get_dog(name, breed):
298+
return {'name': name, 'breed': breed}
299+
300+
dog = get_dog('Ahri', 'Pomeranian')
301+
print(dog)
302+
"""
303+
)
304+
305+
expected = textwrap.dedent(
306+
"""\
307+
def get_dog(name, breed):
308+
return {'name': name, 'breed': breed}
309+
310+
dog = get_dog('Ahri', 'Pomeranian')
311+
print(dog)
312+
"""
313+
)
314+
315+
result = normalizeSelection.normalize_lines(src)
316+
317+
assert result == expected

0 commit comments

Comments
 (0)