def testGetMetadataAfterFirstEntry(self): ''' TfImporter : test that the metadata gets populated during retrieval of entries ''' tfi = TfCsvImport(TfInputCsvFile, StartYear="2012" ) tfi.EnableImportByTeacher(Teacher1Initials) tfi.next() MD = tfi.GetMetaData() self.assertEqual(tfi.GetMetaData(), TfInputCsvMetaData)
def testGetNextEntry(self): ''' TfImporter : test the retrieval of the first entry (Teacher1) ''' tfi = TfCsvImport(TfInputCsvFile , StartYear="2012" ) tfi.EnableImportByTeacher(Teacher1Initials) #print(tfi.next()) ad = tfi.next() self.assertEqual( ad, Teacher1FirstClass )
def testGetNextEntryMultipleTimes(self): ''' TfImporter : test the retrieval of the mulitple entries ''' tfi = TfCsvImport(TfInputCsvFile, StartYear="2012" ) tfi.EnableImportByTeacher(Teacher1Initials) for i in range(0, len(Teacher1Classes )): ad = tfi.next() self.assertEqual( ad, Teacher1Classes[i], "entry #%d mismatch"%i )
def testRestartSearch(self): ''' TfImporter : test restarting search with new teacher ''' tfi = TfCsvImport(TfInputCsvFile , StartYear="2012" ) tfi.EnableImportByTeacher(Teacher1Initials) self.assertEqual( tfi.next(), Teacher1FirstClass ) tfi.EnableImportByTeacher(Teacher2Initials) ad = tfi.next() self.assertEqual( ad, Teacher2FirstClass )
def testGetNextEntryEverything(self): ''' TfImporter : test the retrieval of the first entry (Class 1)''' tfi = TfCsvImport(TfInputCsvFile ) tfi.EnableImportAll() ADFromDb = tfi.next() self.assertEqual( ADFromDb, FirstActivityInFile )
def testGetNextEntryWithClass(self): ''' TfImporter : test the retrieval of the first entry (Class 1)''' tfi = TfCsvImport(TfInputCsvFile ) tfi.EnableImportByClass(Class1Name) ad = tfi.next() self.assertEqual( ad, Class1FirstClass )
def testGetNextEntryRepeated(self, Teacher): ''' test the retrieval of the first entry (by list)''' tfi = TfCsvImport(TfInputCsvFile, StartYear="2012" ) tfi.EnableImportByTeacher(Teacher ) self.assertEqual( tfi.next(), TeacherData[Teacher]['FirstCourse'] )
def testGetNextEntryWithDiffTeacher(self): ''' TfImporter : test the retrieval of the first entry (teacher2)''' tfi = TfCsvImport(TfInputCsvFile, StartYear="2012" ) tfi.EnableImportByTeacher(Teacher2Initials) self.assertEqual( tfi.next(), Teacher2FirstClass )