Exemple #1
0
 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)
Exemple #2
0
 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 )
Exemple #3
0
 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 )
Exemple #4
0
 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 )
Exemple #5
0
 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 )
Exemple #6
0
 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 )
Exemple #7
0
 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'] )
Exemple #8
0
 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 )