|
4 | 4 |
|
5 | 5 | class test_absSort(unittest.TestCase):
|
6 | 6 | def testcase_1(self):
|
7 |
| - myInput = [2,-7,-2,-2,0] |
8 |
| - expected = [0,-2,-2,2,-7] |
| 7 | + myInput = [2, -7, -2, -2, 0] |
| 8 | + expected = [0, -2, -2, 2, -7] |
9 | 9 | self.assertEqual(absSort(myInput), expected)
|
10 | 10 |
|
11 | 11 | def testcase_2(self):
|
12 |
| - myInput = [-2,1] |
13 |
| - expected = [1,-2] |
| 12 | + myInput = [-2, 1] |
| 13 | + expected = [1, -2] |
14 | 14 | self.assertEqual(absSort(myInput), expected)
|
15 |
| - |
| 15 | + |
16 | 16 | def testcase_3(self):
|
17 |
| - myInput = [0,1,2] |
18 |
| - expected =[0,1,2] |
| 17 | + myInput = [0, 1, 2] |
| 18 | + expected = [0, 1, 2] |
19 | 19 | self.assertEqual(absSort(myInput), expected)
|
20 |
| - |
| 20 | + |
21 | 21 | def testcase_4(self):
|
22 |
| - myInput = [2,-1,-1,-1] |
23 |
| - expected =[-1,-1,-1,2] |
| 22 | + myInput = [2, -1, -1, -1] |
| 23 | + expected = [-1, -1, -1, 2] |
24 | 24 | self.assertEqual(absSort(myInput), expected)
|
25 |
| - |
| 25 | + |
26 | 26 | def testcase_5(self):
|
27 |
| - myInput = [-2,3,5,-1,4] |
28 |
| - expected = [-1,-2,3,4,5] |
| 27 | + myInput = [-2, 3, 5, -1, 4] |
| 28 | + expected = [-1, -2, 3, 4, 5] |
29 | 29 | self.assertEqual(absSort(myInput), expected)
|
30 |
| - |
| 30 | + |
31 | 31 | def testcase_6(self):
|
32 |
| - myInput = [4,-1,6,-4,2,-1] |
33 |
| - expected = [-1,-1,2,-4,4,6] |
| 32 | + myInput = [4, -1, 6, -4, 2, -1] |
| 33 | + expected = [-1, -1, 2, -4, 4, 6] |
34 | 34 | self.assertEqual(absSort(myInput), expected)
|
35 |
| - |
| 35 | + |
36 | 36 | def testcase_7(self):
|
37 |
| - myInput = [6,4,-5,0,-1,7,0] |
38 |
| - expected =[0,0,-1,4,-5,6,7] |
| 37 | + myInput = [6, 4, -5, 0, -1, 7, 0] |
| 38 | + expected = [0, 0, -1, 4, -5, 6, 7] |
39 | 39 | self.assertEqual(absSort(myInput), expected)
|
40 |
| - |
| 40 | + |
41 | 41 | def testcase_8(self):
|
42 |
| - myInput = [-7,-2,-2,6,5,-6,-2,-6] |
43 |
| - expected = [-2,-2,-2,5,-6,-6,6,-7] |
| 42 | + myInput = [-7, -2, -2, 6, 5, -6, -2, -6] |
| 43 | + expected = [-2, -2, -2, 5, -6, -6, 6, -7] |
44 | 44 |
|
45 | 45 | self.assertEqual(absSort(myInput), expected)
|
46 |
| - |
| 46 | + |
47 | 47 | def testcase_9(self):
|
48 |
| - myInput =[-4,9,-1,1,-1,2,-8,-6,3] |
49 |
| - expected = [-1,-1,1,2,3,-4,-6,-8,9] |
| 48 | + myInput = [-4, 9, -1, 1, -1, 2, -8, -6, 3] |
| 49 | + expected = [-1, -1, 1, 2, 3, -4, -6, -8, 9] |
50 | 50 | self.assertEqual(absSort(myInput), expected)
|
51 | 51 |
|
52 | 52 |
|
53 |
| - |
54 |
| - |
55 | 53 | def main():
|
56 | 54 | unittest.main()
|
57 | 55 |
|
| 56 | + |
58 | 57 | if __name__ == "__main__":
|
59 | 58 | main()
|
0 commit comments