Skip to content

daimondBoss/geometry-unit-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Math formulas

Area

  • Circle: S = πR²
  • Rectangle: S = ab
  • Square: S = a²

Perimeter

  • Circle: P = 2πR
  • Rectangle: P = 2a + 2b
  • Square: P = 4a

geometriclib

Общее описание

geometriclib - библиотека для работы с площадью и периметром квадратов и кругов в проектах на python.

Start

Клонируйте этот репозиторий в свой проект

'''bash cd project/path/ git clone git clone https://github.com/smartiqaorg/geometric_lib git '''

В python файле импортируйте библиотеку

'''py import geometric_lib.circle as circle, geometric_lib.square as square

print (circle.perimeter(10)) # 62.83184 print (square.area(10)) # 100 '''

Доступные функции и примеры вызова

'''py circle.area(r) # Площадь круга с радиусом r coin_area = circle.area(5) # 78.54

circle.perimeter(r) # Периметр круга (окружности) с радиусом r coin_perimeter = circle.perimeter(5) # 31.42

square.area(a) # Площадь квадрата со строной а tile_area = square.area(3) # 9

square.perimeter(a) # Периметр квадрата со стороной а tile_perimeter = square.perimeter(8) # 32

Тестирование

Unit-тесты

Проект включает comprehensive unit-тесты для всех математических функций.

Запуск тестов:

# Запуск тестов для конкретного модуля
python -m unittest test_rectangle.py -v
python -m unittest test_triangle.py -v
python -m unittest test_circle.py -v
python -m unittest test_square.py -v

История изменений

98d9c16 (HEAD -> main, origin/main) FIXED correct imports in test files to resolve module loading

bd0cc86 Add testing instructions and project documentation

e383937 Add unit tests for all geometry modules

bceafa9 Add basic geometry functions

7ab3091 (HEAD -> main) Added new file square.py

c43b580 Added new file circle.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages