Deffinately not a bicycle
There is just a bunch of functions. No objects, no structure, only hardcore
There is 3 files, each for one geometric shape:
- Square
- Rectangle
- Trinagle
with area() and perimeter() functions for each shape.
Parameters: a (positive int): len of the side of a square Returns: (positive int) area of the square Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> area(3)
9
Parameters: a (positive int): len of the side of a square Returns: (positive int) perimeter of the square Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> perimeter(3)
12
Parameters: a, b (positive int): len of the sides of a rectangle Returns: (positive int) area of the rectangle Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> area(3, 4)
12
Parameters: a, b (positive int): sidse of a rectangle Returns: (positive int) perimeter of the rectangle Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> perimeter(3, 4)
14
Parameters: a (positive int): side of a triangle, h (positive int): height of a triangle Returns: (positive int) area of the triangle Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> area(3, 4)
6
Parameters: a, b, c (positive int): sides of a triangle Returns: (positive int) perimeter of the triangle Raises: TypeErorr if value is not integer and ValueError if it's negative or zero
>>> perimeter(3, 4, 5)
12
There is "tests" directory for your tests and test.py file with 3 basic tests classes, one for each figure
There is "tester.py" file, which contains CustomTestResult and CustomTestRunner classes. By importing test to this file and running it you can get table of tests results with some extra data
And it runs custom tester on every push on windows and ubuntu.
It works fine now
Was:
return a + bNow:
return 2 * (a + b)commit 0e134b811d1074c917fdd10df4ae34a1deabc243
commit 614d6840bec8a8650737969e9c42b4bb382a7d3d
commit d078c8d9ee6155f3cb0e577d28d337b791de28e2
And also functions had been changed due to tests
72151de99f61a458e1510abd3fa05bd4c95ecf7c
And also functions had been changed due to tests Again
18e01f1def6740abe0a23c831f14d365742b667e