Beispiel #1
0
def test_save_to_disk():
    """ Since we already tested the information contained in the thank you letter, 
    we only need to test if the letter is correctly saved to the disk"""
    donor = Donor("Abby Lin", 5000)
    donor.save_to_disk("thank_you_letters")

    os.chdir("thank_you_letters")
    assert os.path.isfile("Abby_Lin.txt")
    with open("Abby_Lin.txt") as f:
        size = len(f.read())
    assert size > 0