Example #1
0
def test_thank_you():
    a = Donor("Scrooge McDuck", 100.00)
    print(a.thank_you())
    assert a.thank_you() == """
    Dear Scrooge McDuck,
    
    Thank you for your most recent donation of $100.00. We are humbled by your 
    lifetime contribution of $100.00.
    
    Sincerly,
    Making Good Things Happen"""
    a.new_donation(1000.00)
    assert a.thank_you() == """
Example #2
0
def test_thank_you_file():
    a = Donor("TestSting1", 300.00)
    b = Donor("Test Sting2", 300.00)
    c = Donor("Test-Sting3", 300.00)
    a.create_file()
    b.create_file()
    c.create_file()
    assert os.path.isfile("teststing1.txt") == True
    assert os.path.isfile("test_sting2.txt") == True
    assert os.path.isfile("test-sting3.txt") == True
    with open("teststing1.txt", 'r') as file:
            letter = file.read()
    print(letter)
    print(a.thank_you())
    assert letter == a.thank_you()