From bb681f9dae1f5f3bb03ca3d860c9bd2fbac81338 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 23 May 2019 09:08:31 -0700 Subject: [PATCH 1/5] Bob: sync expected test results and input data with problem-specifications (#1784) * Bob: sync expected test results and input data with problem-specifications. --- exercises/bob/bob.py | 2 +- exercises/bob/bob_test.py | 55 ++++++++++++++++++++------------------- exercises/bob/example.py | 24 ++++++++--------- 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/exercises/bob/bob.py b/exercises/bob/bob.py index 0c4235d4799..94a7315112e 100644 --- a/exercises/bob/bob.py +++ b/exercises/bob/bob.py @@ -1,2 +1,2 @@ -def hey(phrase): +def response(hey_bob): pass diff --git a/exercises/bob/bob_test.py b/exercises/bob/bob_test.py index 9647173db5f..6c032c61746 100644 --- a/exercises/bob/bob_test.py +++ b/exercises/bob/bob_test.py @@ -1,100 +1,101 @@ import unittest -from bob import hey +from bob import response # Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0 class BobTest(unittest.TestCase): def test_stating_something(self): - self.assertEqual(hey("Tom-ay-to, tom-aaaah-to."), "Whatever.") + self.assertEqual(response("Tom-ay-to, tom-aaaah-to."), "Whatever.") def test_shouting(self): - self.assertEqual(hey("WATCH OUT!"), "Whoa, chill out!") + self.assertEqual(response("WATCH OUT!"), "Whoa, chill out!") def test_shouting_gibberish(self): - self.assertEqual(hey("FCECDFCAAB"), "Whoa, chill out!") + self.assertEqual(response("FCECDFCAAB"), "Whoa, chill out!") def test_asking_a_question(self): self.assertEqual( - hey("Does this cryogenic chamber make me look fat?"), "Sure.") + response("Does this cryogenic chamber make me look fat?"), "Sure.") def test_asking_a_numeric_question(self): - self.assertEqual(hey("You are, what, like 15?"), "Sure.") + self.assertEqual(response("You are, what, like 15?"), "Sure.") def test_asking_gibberish(self): - self.assertEqual(hey("fffbbcbeab?"), "Sure.") + self.assertEqual(response("fffbbcbeab?"), "Sure.") def test_talking_forcefully(self): self.assertEqual( - hey("Let's go make out behind the gym!"), "Whatever.") + response("Let's go make out behind the gym!"), "Whatever.") def test_using_acronyms_in_regular_speech(self): self.assertEqual( - hey("It's OK if you don't want to go to the DMV."), + response("It's OK if you don't want to go to the DMV."), "Whatever.") def test_forceful_question(self): self.assertEqual( - hey("WHAT THE HELL WERE YOU THINKING?"), + response("WHAT THE HELL WERE YOU THINKING?"), "Calm down, I know what I'm doing!" ) def test_shouting_numbers(self): - self.assertEqual(hey("1, 2, 3 GO!"), "Whoa, chill out!") + self.assertEqual(response("1, 2, 3 GO!"), "Whoa, chill out!") def test_no_letters(self): - self.assertEqual(hey("1, 2, 3"), "Whatever.") + self.assertEqual(response("1, 2, 3"), "Whatever.") def test_question_with_no_letters(self): - self.assertEqual(hey("4?"), "Sure.") + self.assertEqual(response("4?"), "Sure.") def test_shouting_with_special_characters(self): self.assertEqual( - hey("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"), + response("ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!"), "Whoa, chill out!") def test_shouting_with_no_exclamation_mark(self): - self.assertEqual(hey("I HATE THE DMV"), "Whoa, chill out!") + self.assertEqual(response("I HATE THE DMV"), "Whoa, chill out!") def test_statement_containing_question_mark(self): self.assertEqual( - hey("Ending with ? means a question."), "Whatever.") + response("Ending with ? means a question."), "Whatever.") def test_non_letters_with_question(self): - self.assertEqual(hey(":) ?"), "Sure.") + self.assertEqual(response(":) ?"), "Sure.") def test_prattling_on(self): self.assertEqual( - hey("Wait! Hang on. Are you going to be OK?"), "Sure.") + response("Wait! Hang on. Are you going to be OK?"), "Sure.") def test_silence(self): - self.assertEqual(hey(""), "Fine. Be that way!") + self.assertEqual(response(""), "Fine. Be that way!") def test_prolonged_silence(self): - self.assertEqual(hey(" "), "Fine. Be that way!") + self.assertEqual(response(" "), "Fine. Be that way!") def test_alternate_silence(self): - self.assertEqual(hey("\t\t\t\t\t\t\t\t\t\t"), "Fine. Be that way!") + self.assertEqual(response("\t\t\t\t\t\t\t\t\t\t"), + "Fine. Be that way!") def test_multiple_line_question(self): self.assertEqual( - hey("\nDoes this cryogenic chamber make me look fat?\nNo."), - "Whatever.") + response("\nDoes this cryogenic chamber make me look fat?\n" + "No."), "Whatever.") def test_starting_with_whitespace(self): - self.assertEqual(hey(" hmmmmmmm..."), "Whatever.") + self.assertEqual(response(" hmmmmmmm..."), "Whatever.") def test_ending_with_whitespace(self): self.assertEqual( - hey("Okay if like my spacebar quite a bit? "), "Sure.") + response("Okay if like my spacebar quite a bit? "), "Sure.") def test_other_whitespace(self): - self.assertEqual(hey("\n\r \t"), "Fine. Be that way!") + self.assertEqual(response("\n\r \t"), "Fine. Be that way!") def test_non_question_ending_with_whitespace(self): self.assertEqual( - hey("This is a statement ending with whitespace "), + response("This is a statement ending with whitespace "), "Whatever.") diff --git a/exercises/bob/example.py b/exercises/bob/example.py index 59321761678..630ccccc613 100644 --- a/exercises/bob/example.py +++ b/exercises/bob/example.py @@ -1,26 +1,26 @@ -def hey(stimulus): - stimulus = stimulus.strip() +def response(hey_bob): + hey_bob = hey_bob.strip() - if _is_silence(stimulus): + if _is_silence(hey_bob): return 'Fine. Be that way!' - if _is_shouting(stimulus): - if _is_question(stimulus): + if _is_shouting(hey_bob): + if _is_question(hey_bob): return "Calm down, I know what I'm doing!" else: return 'Whoa, chill out!' - elif _is_question(stimulus): + elif _is_question(hey_bob): return 'Sure.' else: return 'Whatever.' -def _is_silence(stimulus): - return stimulus == '' +def _is_silence(hey_bob): + return hey_bob == '' -def _is_shouting(stimulus): - return stimulus.isupper() +def _is_shouting(hey_bob): + return hey_bob.isupper() -def _is_question(stimulus): - return stimulus.endswith('?') +def _is_question(hey_bob): + return hey_bob.endswith('?') From 4a775f0896fccff17e183695822aad3d88b9994d Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 23 May 2019 09:15:14 -0700 Subject: [PATCH 2/5] Binary-search: sync expected test inputs with problem-specifications (#1783) * Binary-search: sync expected test inputs with problem-specifications --- exercises/binary-search/binary_search.py | 2 +- exercises/binary-search/binary_search_test.py | 25 +++++++++---------- exercises/binary-search/example.py | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/exercises/binary-search/binary_search.py b/exercises/binary-search/binary_search.py index 1bdb370a3b2..7876b94e2cb 100644 --- a/exercises/binary-search/binary_search.py +++ b/exercises/binary-search/binary_search.py @@ -1,2 +1,2 @@ -def binary_search(list_of_numbers, number): +def find(search_list, value): pass diff --git a/exercises/binary-search/binary_search_test.py b/exercises/binary-search/binary_search_test.py index d187ba97af1..1d8f44e73a5 100644 --- a/exercises/binary-search/binary_search_test.py +++ b/exercises/binary-search/binary_search_test.py @@ -1,52 +1,51 @@ import unittest -from binary_search import binary_search +from binary_search import find # Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0 class BinarySearchTest(unittest.TestCase): def test_finds_value_in_array_with_one_element(self): - self.assertEqual(binary_search([6], 6), 0) + self.assertEqual(find([6], 6), 0) def test_finds_value_in_middle_of_array(self): - self.assertEqual(binary_search([1, 3, 4, 6, 8, 9, 11], 6), 3) + self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 6), 3) def test_finds_value_at_beginning_of_array(self): - self.assertEqual(binary_search([1, 3, 4, 6, 8, 9, 11], 1), 0) + self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 1), 0) def test_finds_value_at_end_of_array(self): - self.assertEqual(binary_search([1, 3, 4, 6, 8, 9, 11], 11), 6) + self.assertEqual(find([1, 3, 4, 6, 8, 9, 11], 11), 6) def test_finds_value_in_array_of_odd_length(self): self.assertEqual( - binary_search([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634], - 144), 9) + find([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634], 144), 9) def test_finds_value_in_array_of_even_length(self): self.assertEqual( - binary_search([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377], 21), + find([1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377], 21), 5) def test_identifies_value_missing(self): with self.assertRaisesWithMessage(ValueError): - binary_search([1, 3, 4, 6, 8, 9, 11], 7) + find([1, 3, 4, 6, 8, 9, 11], 7) def test_value_smaller_than_arrays_minimum(self): with self.assertRaisesWithMessage(ValueError): - binary_search([1, 3, 4, 6, 8, 9, 11], 0) + find([1, 3, 4, 6, 8, 9, 11], 0) def test_value_larger_than_arrays_maximum(self): with self.assertRaisesWithMessage(ValueError): - binary_search([1, 3, 4, 6, 8, 9, 11], 13) + find([1, 3, 4, 6, 8, 9, 11], 13) def test_empty_array(self): with self.assertRaisesWithMessage(ValueError): - binary_search([], 1) + find([], 1) def test_nothing_is_found_when_left_and_right_bounds_cross(self): with self.assertRaisesWithMessage(ValueError): - binary_search([1, 2], 0) + find([1, 2], 0) # Utility functions def setUp(self): diff --git a/exercises/binary-search/example.py b/exercises/binary-search/example.py index 0b8f73a3c74..0643ee62c0d 100644 --- a/exercises/binary-search/example.py +++ b/exercises/binary-search/example.py @@ -1,4 +1,4 @@ -def binary_search(search_list, value): +def find(search_list, value): low = 0 high = len(search_list) - 1 while low <= high: From aa8180a5bbabda4bd3c2b1b8fe9eb3cfc9700939 Mon Sep 17 00:00:00 2001 From: BethanyG Date: Thu, 23 May 2019 09:26:51 -0700 Subject: [PATCH 3/5] Saddle-point: sync expected test results with problem-specifications (#1782) * saddle-points: sync tests expected results with problem-specifications and update example solution. --- exercises/saddle-points/example.py | 20 ++++++++------- exercises/saddle-points/saddle_points_test.py | 25 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/exercises/saddle-points/example.py b/exercises/saddle-points/example.py index 76cbaedb160..0a62e8d5454 100644 --- a/exercises/saddle-points/example.py +++ b/exercises/saddle-points/example.py @@ -1,11 +1,13 @@ -def saddle_points(m): - if not m: - return set() - if any(len(r) != len(m[0]) for r in m): +def saddle_points(matrix): + if not matrix: + return [{}] + if any(len(row) != len(matrix[0]) for row in matrix): raise ValueError('irregular matrix') - mmax = [max(r) for r in m] - mmin = [min(c) for c in zip(*m)] - points = [(i+1, j+1) for i in range(len(m)) - for j in range(len(m[0])) if mmax[i] == mmin[j]] + mmax = [max(row) for row in matrix] + mmin = [min(col) for col in zip(*matrix)] + points = [{"row": index + 1, "column": col_index + 1} + for index in range(len(matrix)) + for col_index in range(len(matrix[0])) + if mmax[index] == mmin[col_index]] - return set(points) + return points or [{}] diff --git a/exercises/saddle-points/saddle_points_test.py b/exercises/saddle-points/saddle_points_test.py index 636c5ec3883..e99c73ff735 100644 --- a/exercises/saddle-points/saddle_points_test.py +++ b/exercises/saddle-points/saddle_points_test.py @@ -15,45 +15,50 @@ class SaddlePointsTest(unittest.TestCase): def test_identify_single_saddle_point(self): matrix = [[9, 8, 7], [5, 3, 2], [6, 6, 7]] - self.assertEqual(saddle_points(matrix), set([(2, 1)])) + self.assertEqual(saddle_points(matrix), [{"row": 2, "column": 1}]) def test_empty_matrix_has_no_saddle_points(self): - self.assertEqual(saddle_points([]), set()) + self.assertEqual(saddle_points([]), [dict()]) def test_matrix_with_one_elem_has_single_saddle_point(self): matrix = [[1]] - self.assertEqual(saddle_points(matrix), set([(1, 1)])) + self.assertEqual(saddle_points(matrix), [{"row": 1, "column": 1}]) def test_identify_lack_of_saddle_points_when_there_are_none(self): matrix = [[1, 2, 3], [3, 1, 2], [2, 3, 1]] - self.assertEqual(saddle_points(matrix), set()) + self.assertEqual(saddle_points(matrix), [dict()]) def test_identify_multiple_saddle_points_in_column(self): matrix = [[4, 5, 4], [3, 5, 5], [1, 5, 4]] - expected = set([(1, 2), (2, 2), (3, 2)]) + expected = [{"row": 1, "column": 2}, {"row": 2, "column": 2}, + {"row": 3, "column": 2}] self.assertEqual(saddle_points(matrix), expected) def test_identify_multiple_saddle_points_in_row(self): matrix = [[6, 7, 8], [5, 5, 5], [7, 5, 6]] - expected = set([(2, 1), (2, 2), (2, 3)]) + expected = [{"row": 2, "column": 1}, {"row": 2, "column": 2}, + {"row": 2, "column": 3}] self.assertEqual(saddle_points(matrix), expected) def test_identify_saddle_point_in_bottom_right_corner(self): matrix = [[8, 7, 9], [6, 7, 6], [3, 2, 5]] - expected = set([(3, 3)]) + expected = [{"row": 3, "column": 3}] self.assertEqual(saddle_points(matrix), expected) def test_non_square_matrix_with_2_saddle_points(self): matrix = [[3, 1, 3], [3, 2, 4]] - self.assertEqual(saddle_points(matrix), set([(1, 3), (1, 1)])) + self.assertEqual(saddle_points(matrix), [{"row": 1, "column": 1}, + {"row": 1, "column": 3}]) def test_single_column_matrix_has_saddle_point_min_value(self): matrix = [[2], [1], [4], [1]] - self.assertEqual(saddle_points(matrix), set([(2, 1), (4, 1)])) + self.assertEqual(saddle_points(matrix), [{"row": 2, "column": 1}, + {"row": 4, "column": 1}]) def test_single_row_matrix_has_saddle_point_in_max_value(self): matrix = [[2, 5, 3, 5]] - self.assertEqual(saddle_points(matrix), set([(1, 2), (1, 4)])) + self.assertEqual(saddle_points(matrix), [{"row": 1, "column": 2}, + {"row": 1, "column": 4}]) # Additional tests for this track From 2c80c7942fb2e6f9be49e06bb028fb0abbf564d7 Mon Sep 17 00:00:00 2001 From: Stig Johan Berggren Date: Thu, 23 May 2019 18:29:18 +0200 Subject: [PATCH 4/5] collatz-conjecture: sync with problem-specifications (#1785) * Collatz-conjecture: rename collatz_steps to steps --- .../collatz-conjecture/collatz_conjecture.py | 2 +- .../collatz_conjecture_test.py | 22 +++++++++---------- exercises/collatz-conjecture/example.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/exercises/collatz-conjecture/collatz_conjecture.py b/exercises/collatz-conjecture/collatz_conjecture.py index 8db473b0965..17404248f60 100644 --- a/exercises/collatz-conjecture/collatz_conjecture.py +++ b/exercises/collatz-conjecture/collatz_conjecture.py @@ -1,2 +1,2 @@ -def collatz_steps(number): +def steps(number): pass diff --git a/exercises/collatz-conjecture/collatz_conjecture_test.py b/exercises/collatz-conjecture/collatz_conjecture_test.py index 3ad09b19f0f..690bf7eb09b 100644 --- a/exercises/collatz-conjecture/collatz_conjecture_test.py +++ b/exercises/collatz-conjecture/collatz_conjecture_test.py @@ -1,31 +1,31 @@ import unittest -from collatz_conjecture import collatz_steps +from collatz_conjecture import steps # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.1 -class CollatzConjectureTest(unittest.TestCase): +class CollatzConjectureTest(unittest.TestCase): def test_zero_steps_for_one(self): - self.assertEqual(collatz_steps(1), 0) + self.assertEqual(steps(1), 0) def test_divide_if_even(self): - self.assertEqual(collatz_steps(16), 4) + self.assertEqual(steps(16), 4) def test_even_and_odd_steps(self): - self.assertEqual(collatz_steps(12), 9) + self.assertEqual(steps(12), 9) def test_large_number_of_even_and_odd_steps(self): - self.assertEqual(collatz_steps(1000000), 152) + self.assertEqual(steps(1000000), 152) - def test_zero_is_invalid_input(self): + def test_zero_is_an_error(self): with self.assertRaisesWithMessage(ValueError): - collatz_steps(0) + steps(0) - def test_negative_number_is_invalid_input(self): + def test_negative_value_is_an_error(self): with self.assertRaisesWithMessage(ValueError): - collatz_steps(-15) + steps(-15) # Utility functions def setUp(self): @@ -38,5 +38,5 @@ def assertRaisesWithMessage(self, exception): return self.assertRaisesRegex(exception, r".+") -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/exercises/collatz-conjecture/example.py b/exercises/collatz-conjecture/example.py index 181b6cf735a..b784225600f 100644 --- a/exercises/collatz-conjecture/example.py +++ b/exercises/collatz-conjecture/example.py @@ -1,4 +1,4 @@ -def collatz_steps(n): +def steps(n): if n <= 0: raise ValueError("input should be positive") From 29f98149a4f7f7f2964a47fd3e2d367ebb1ed065 Mon Sep 17 00:00:00 2001 From: Stig Johan Berggren Date: Thu, 23 May 2019 18:34:54 +0200 Subject: [PATCH 5/5] triangle: sync with problem-specifications (#1786) * triangle: Update function and test names Brings the exercise in line with canonical-data 1.2.1 --- exercises/triangle/example.py | 18 +++++------ exercises/triangle/triangle.py | 6 ++-- exercises/triangle/triangle_test.py | 49 +++++++++++++++-------------- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/exercises/triangle/example.py b/exercises/triangle/example.py index 36441c2b545..063dfec2079 100644 --- a/exercises/triangle/example.py +++ b/exercises/triangle/example.py @@ -1,20 +1,18 @@ def valid(sides): - return ( - sum(sorted(sides)[:2]) >= sorted(sides)[2] and - all(s > 0 for s in sides) + return sum(sorted(sides)[:2]) >= sorted(sides)[2] and all( + s > 0 for s in sides ) -def is_equilateral(sides): +def equilateral(sides): return valid(sides) and all(sides[0] == s for s in sides) -def is_isosceles(sides): - return ( - valid(sides) and - any(s1 == s2 for s1, s2 in zip(sorted(sides), sorted(sides)[1:])) +def isosceles(sides): + return valid(sides) and any( + s1 == s2 for s1, s2 in zip(sorted(sides), sorted(sides)[1:]) ) -def is_scalene(sides): - return valid(sides) and not is_isosceles(sides) +def scalene(sides): + return valid(sides) and not isosceles(sides) diff --git a/exercises/triangle/triangle.py b/exercises/triangle/triangle.py index 9e3d5cf3415..3d088c774e8 100644 --- a/exercises/triangle/triangle.py +++ b/exercises/triangle/triangle.py @@ -1,10 +1,10 @@ -def is_equilateral(sides): +def equilateral(sides): pass -def is_isosceles(sides): +def isosceles(sides): pass -def is_scalene(sides): +def scalene(sides): pass diff --git a/exercises/triangle/triangle_test.py b/exercises/triangle/triangle_test.py index 1a61dd1dd4e..1221e4c2714 100644 --- a/exercises/triangle/triangle_test.py +++ b/exercises/triangle/triangle_test.py @@ -1,72 +1,73 @@ import unittest -from triangle import is_equilateral, is_isosceles, is_scalene +from triangle import equilateral, isosceles, scalene # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.1 -class is_equilateralTests(unittest.TestCase): + +class TestEquilateralTriangle(unittest.TestCase): def test_all_sides_are_equal(self): - self.assertIs(is_equilateral([2, 2, 2]), True) + self.assertIs(equilateral([2, 2, 2]), True) def test_any_side_is_unequal(self): - self.assertIs(is_equilateral([2, 3, 2]), False) + self.assertIs(equilateral([2, 3, 2]), False) def test_no_sides_are_equal(self): - self.assertIs(is_equilateral([5, 4, 6]), False) + self.assertIs(equilateral([5, 4, 6]), False) def test_all_zero_sides_is_not_a_triangle(self): - self.assertIs(is_equilateral([0, 0, 0]), False) + self.assertIs(equilateral([0, 0, 0]), False) def test_sides_may_be_floats(self): - self.assertIs(is_equilateral([0.5, 0.5, 0.5]), True) + self.assertIs(equilateral([0.5, 0.5, 0.5]), True) -class is_isoscelesTests(unittest.TestCase): +class TestIsoscelesTriangle(unittest.TestCase): def test_last_two_sides_are_equal(self): - self.assertIs(is_isosceles([3, 4, 4]), True) + self.assertIs(isosceles([3, 4, 4]), True) def test_first_two_sides_are_equal(self): - self.assertIs(is_isosceles([4, 4, 3]), True) + self.assertIs(isosceles([4, 4, 3]), True) def test_first_and_last_sides_are_equal(self): - self.assertIs(is_isosceles([4, 3, 4]), True) + self.assertIs(isosceles([4, 3, 4]), True) def test_equilateral_triangles_are_also_isosceles(self): - self.assertIs(is_isosceles([4, 4, 4]), True) + self.assertIs(isosceles([4, 4, 4]), True) def test_no_sides_are_equal(self): - self.assertIs(is_isosceles([2, 3, 4]), False) + self.assertIs(isosceles([2, 3, 4]), False) def test_first_triangle_inequality_violation(self): - self.assertIs(is_isosceles([1, 1, 3]), False) + self.assertIs(isosceles([1, 1, 3]), False) def test_second_triangle_inequality_violation(self): - self.assertIs(is_isosceles([1, 3, 1]), False) + self.assertIs(isosceles([1, 3, 1]), False) def test_third_triangle_inequality_violation(self): - self.assertIs(is_isosceles([3, 1, 1]), False) + self.assertIs(isosceles([3, 1, 1]), False) def test_sides_may_be_floats(self): - self.assertIs(is_isosceles([0.5, 0.4, 0.5]), True) + self.assertIs(isosceles([0.5, 0.4, 0.5]), True) -class is_scaleneTests(unittest.TestCase): +class TestScaleneTriangle(unittest.TestCase): def test_no_sides_are_equal(self): - self.assertIs(is_scalene([5, 4, 6]), True) + self.assertIs(scalene([5, 4, 6]), True) def test_all_sides_are_equal(self): - self.assertIs(is_scalene([4, 4, 4]), False) + self.assertIs(scalene([4, 4, 4]), False) def test_two_sides_are_equal(self): - self.assertIs(is_scalene([4, 4, 3]), False) + self.assertIs(scalene([4, 4, 3]), False) def test_may_not_violate_triangle_inequality(self): - self.assertIs(is_scalene([7, 3, 2]), False) + self.assertIs(scalene([7, 3, 2]), False) def test_sides_may_be_floats(self): - self.assertIs(is_scalene([0.5, 0.4, 0.6]), True) + self.assertIs(scalene([0.5, 0.4, 0.6]), True) -if __name__ == '__main__': +if __name__ == "__main__": unittest.main()