I am working on a small python desktop project, which can calculate the human BMI (BMI is your weight ver your height squared). My application works fine, but I have no idea how to write a unit test for it.
Here is the part of my code (the main function) I want to test:
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import math
class MY_BMI_Calculator:
def __init__(self,master):
master.title('BMI Calculator')
def calculate_BMI(self):
self.inchs = int(self.entry_ft.get())* 12 + int(self.entry_in.get())
self.BMI = int(self.entry_weight.get())* 703 /math.pow(self.inchs,2)
return round(self.BMI,1)