How can I test class code?

How did you test your code? I guess I’m having a little of a hard time understanding this, so having a harder time verifying if my code is right.

Specifically for the average() and the .attendance parts.

Here is what I have so far:

import datetime
time_now = datetime.datetime.now()

print()

class Student:
def init(self, name, year, today):
self.name = name
self.year = year
self.grades =
self.attendance = {}
if today == time_now.strftime("%x"):
self.attendance.update({today:True})
else:
self.attendance.update({today:False})

def add_grade(self, grade):
if type(grade) == Grade:
self.grades.append(grade)
def get_average(self):
average = self.grade.mean()
return average

class Grade:
minimum_passing = 65

def init(self, score):
self.score = score
def is_passing(self):
if self.score >= minimum_passing:
return “Pass”
else:
return “Fail”
def repr(self):
return str(self.score)

roger = Student(“Roger van der Weyden”, 10, “11/22/2018”)
sandro = Student(“Sandro Botticelli”, 12, “11/22/2018”)
pieter = Student(“Pieter Bruegel the Elder”, 8,“11/22/2018”)
pieter.add_grade(Grade(100))