diff --git a/participants/scipy_002/pr_tutorial/buggy_function.py b/participants/scipy_002/pr_tutorial/buggy_function.py index 6f38a6b..ab5b2fe 100644 --- a/participants/scipy_002/pr_tutorial/buggy_function.py +++ b/participants/scipy_002/pr_tutorial/buggy_function.py @@ -20,7 +20,7 @@ def angle_to_sexigesimal(angle_in_degrees, decimals=3): if math.floor(decimals) != decimals: raise OSError('decimals should be an integer!') - hours_num = angle_in_degrees*24/180 + hours_num = angle_in_degrees*24/360 hours = math.floor(hours_num) min_num = (hours_num - hours)*60 diff --git a/participants/scipy_002/pr_tutorial/tests/test_buggy_function.py b/participants/scipy_002/pr_tutorial/tests/test_buggy_function.py new file mode 100644 index 0000000..bf4737b --- /dev/null +++ b/participants/scipy_002/pr_tutorial/tests/test_buggy_function.py @@ -0,0 +1,6 @@ +from pr_tutorial.buggy_function import angle_to_sexigesimal + + +def test_angle_to_sexigesimal_360(): + """Simplest test for one crete case""" + assert angle_to_sexigesimal(360.0) == '24:0:0.000'