from tkinter import *

### Function Practice Code

def average(num1, num2, num3, num4):
    pass

def converter(num, txt):
    pass

def introduction(name, age):
    pass

### You may want to replace this line with something
def area(radius, canvas):
    pass

### Test Functions DO NOT EDIT ANYTHING BELOW THIS LINE ###

def test_average():
    assert(average(4, 4, 4, 4) == 4)
    assert(average(1, 2, 3, 4) == 2.5)
    assert(average(10, 24, 31, 78) == 35.75)
    assert(average(-2, 2, 2, -2) == 0)
    print("Passed all test cases for the average function!")

def test_converter():
    assert(converter(52,"Pickup") == "52Pickup")
    assert(converter(6,"Apples") == "6Apples")
    assert(converter(14,"Shreks") == "14Shreks")
    print("Passed all test cases for the converter function!")

def test_introduction():
    print("For the converter function, check that your string spacing is correct...")
    print("Passed all test cases for the introduction function!")

def test_area_graphics(radius):
    root = Tk()
    root.resizable(width=False, height=False) # non-resizable
    canvas = Canvas(root, width=400, height=400)
    canvas.configure(bd=0, highlightthickness=0)
    canvas.pack()
    answer = area(radius, canvas)
    root.mainloop()
    return answer

def test_area():
    assert(test_area_graphics(30) == 900*(math.pi))
    assert(test_area_graphics(50) == 2500*(math.pi))
    print("Passed all test cases for the area function!")

def run_tests():
    test_average()
    test_converter()
    test_introduction()
    test_area()
    print("All functions passed!!!")

run_tests()