Chapter 4
Creating an Isolated Test Environment with Test Doubles
Section 5
Adding Code to Checkout Cart to Read Prices from a File
In this video, we will update the Checkout class to have a function to read in item prices from a file and we’ll mock out the file system calls in our unit test. - Implement the 1st test case to be able to call the new readPricesFile method - Implement the second test case where the readPricesFile method is updated to actually open and read the lines from the file - Review the mock setup code in the unit test to ensure you understand how the mocks are allowing the python “with” operator to work and to then iterate over the lines being read from the mocked file object