Skip to content

Commit f2cf1a0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent fe8e935 commit f2cf1a0

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

test_algo/test_bubble_sort.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import unittest
21
import random
2+
import unittest
3+
34
from sorts.bubble_sort import bubble_sort
45

56

@@ -12,7 +13,9 @@ def test_bubble_sort(self):
1213
self.assertEqual(bubble_sort([]), sorted([]))
1314
self.assertEqual(bubble_sort([-2, -45, -5]), sorted([-2, -45, -5]))
1415
self.assertEqual(bubble_sort([-23, 0, 6, -4, 34]), sorted([-23, 0, 6, -4, 34]))
15-
self.assertEqual(bubble_sort(['d', 'a', 'b', 'e', 'c']), sorted(['d', 'a', 'b', 'e', 'c']))
16+
self.assertEqual(
17+
bubble_sort(["d", "a", "b", "e", "c"]), sorted(["d", "a", "b", "e", "c"])
18+
)
1619

1720
def test_bubble_sort_random(self):
1821

@@ -21,8 +24,10 @@ def test_bubble_sort_random(self):
2124

2225
def test_bubble_sort_string(self):
2326
import string
27+
2428
collection = random.choices(string.ascii_letters + string.digits, k=100)
2529
self.assertEqual(bubble_sort(collection), sorted(collection))
26-
27-
if __name__ == '__main__':
30+
31+
32+
if __name__ == "__main__":
2833
unittest.main()

test_algo/test_radix_sort.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
23
from sorts.radix_sort import radix_sort
34

45

@@ -11,20 +12,24 @@ def test_radix_sort(self):
1112
self.assertEqual(radix_sort([]), sorted([]))
1213
self.assertEqual(radix_sort([-2, -45, -5]), sorted([-2, -45, -5]))
1314
self.assertEqual(radix_sort([-23, 0, 6, -4, 34]), sorted([-23, 0, 6, -4, 34]))
14-
self.assertEqual(radix_sort(['d', 'a', 'b', 'e', 'c']), sorted(['d', 'a', 'b', 'e', 'c']))
15+
self.assertEqual(
16+
radix_sort(["d", "a", "b", "e", "c"]), sorted(["d", "a", "b", "e", "c"])
17+
)
1518

1619
def test_radix_sort_random(self):
1720
import random
21+
1822
collection = random.sample(range(-50, 50), 100)
1923
self.assertEqual(radix_sort(collection), sorted(collection))
2024

2125
def test_radix_sort_string(self):
2226
import random
2327
import string
28+
2429
collection = random.choices(string.ascii_letters + string.digits, k=100)
2530
self.assertEqual(radix_sort(collection), sorted(collection))
2631

2732

2833
# main
29-
if __name__ == '__main__':
34+
if __name__ == "__main__":
3035
unittest.main()

0 commit comments

Comments
 (0)