def test_LastLineMock(self): readCSVFile = ReadCSVFile() propertydata = [] propertydata.append("emailAddress, firstName, lastName, password") propertydata.append( "test1:testemail, testfirst, testlast, testpassword") propertydata.append( "test2:testemail2, testfirst2, testlast2, testpassword2") readCSVFile.getFileData = MagicMock(return_value=propertydata) self.assertEqual( "test2:testemail2, testfirst2, testlast2, testpassword2", readCSVFile.getLastLines("customer.csv", 1))
def loadCustomers(self): readCSVFile = ReadCSVFile() customerData = readCSVFile.getFileData("customer") return customerData
def test_FirstItem(self): readCSVFile = ReadCSVFile() self.assertEqual("emailAddress", readCSVFile.getFileData("customer.csv")[0][0])
def test_getFileData(): if "emailAddress" == ReadCSVFile.getFileData("customer.csv")[0][0]: print("Pass","test_getFileData") else: print("fail", "test_getFileData")
def Load_Customers(self): readCSVFile = ReadCSVFile() customerData = readCSVFile.getFileData("customer.csv") return customerData