import unittest
import io
import re
from unittest import mock
import math
import student_X as main #Replace student_X with your filename 
import sys
import io
from io import StringIO
    
    
    
 

class PrintTotalWholesaleCostTests(unittest.TestCase):
    
    def test_default_case(self):
        function = main.print_total_wholesale_cost
        try:
            doc = function.__doc__
        except:
            doc = ""
        correct = doc.strip() != ""
        message = "docstring is blank."
        self.assertTrue(correct, message)

        with mock.patch('sys.stdout', new=io.StringIO()) as fake_stdout:
            function()
        output = fake_stdout.getvalue().strip()

        regex = ".* of 35 books .*"
        feedback = "Doesn't have the correct number of books."
        self.assertRegex(output, regex, feedback)
        
        regex = "The total wholesale cost of 35 books is [1234567890\.]* *\.?"
        feedback = "Text of the output is incorrect."
        self.assertRegex(output, regex, feedback)
        
        regex = "The total wholesale cost of 35 books is \$ ?2002.50? ?\.?"
        feedback = "Doesn't print out the correct total cost."
        self.assertRegex(output, regex, feedback)

        correct = output.endswith('.')
        feedback = "Doesn't end with a period."
        self.assertTrue(correct, feedback)
        
        
if __name__ == "__main__":
    tests = PrintTotalWholesaleCostTests()
    tests.test_default_case()