Add isort pre-commit hook, sort imports in src and test directories

This commit is contained in:
Darren Burns
2023-02-09 13:28:08 +00:00
parent 67c2127e46
commit 9287f64a66
131 changed files with 268 additions and 297 deletions

View File

@@ -20,22 +20,35 @@ def test_sparkline_two_values_min_max():
def test_sparkline_expand_data_to_width():
assert render(Sparkline([2, 4],
width=4)) == f"{GREEN}{STOP}{GREEN}{STOP}{RED}{STOP}{RED}{STOP}"
assert (
render(Sparkline([2, 4], width=4))
== f"{GREEN}{STOP}{GREEN}{STOP}{RED}{STOP}{RED}{STOP}"
)
def test_sparkline_expand_data_to_width_non_divisible():
assert render(Sparkline([2, 4], width=3)) == f"{GREEN}{STOP}{GREEN}{STOP}{RED}{STOP}"
assert (
render(Sparkline([2, 4], width=3))
== f"{GREEN}{STOP}{GREEN}{STOP}{RED}{STOP}"
)
def test_sparkline_shrink_data_to_width():
assert render(Sparkline([2, 2, 4, 4, 6, 6], width=3)) == f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
assert (
render(Sparkline([2, 2, 4, 4, 6, 6], width=3))
== f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
)
def test_sparkline_shrink_data_to_width_non_divisible():
assert render(
Sparkline([1, 2, 3, 4, 5], width=3, summary_function=min)) == f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
assert (
render(Sparkline([1, 2, 3, 4, 5], width=3, summary_function=min))
== f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
)
def test_sparkline_color_blend():
assert render(Sparkline([1, 2, 3], width=3)) == f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
assert (
render(Sparkline([1, 2, 3], width=3))
== f"{GREEN}{STOP}{BLENDED}{STOP}{RED}{STOP}"
)