Ejemplo n.º 1
0
 def testInitialDatabaseHasNoSubjectInfo(self):
     """
     The database must not have any stored subject information if no
     subjects have been added.
     """
     dbParams = DatabaseParameters()
     db = Database(dbParams)
     self.assertEqual([], list(db.getSubjects()))
Ejemplo n.º 2
0
 def testOneReadTwoLandmarksGetSubjects(self):
     """
     If one subject with two landmarks (and hence one hash) is added, an
     entry is appended to the database subject info.
     """
     dbParams = DatabaseParameters(landmarks=[AlphaHelix], trigPoints=[])
     db = Database(dbParams)
     db.addSubject(AARead('id', 'FRRRFRRRFAFRRRFRRRF'))
     subject = list(db.getSubjects())[0]
     read = AARead('id', 'FRRRFRRRFAFRRRFRRRF')
     self.assertEqual(Subject(read, 1), subject)
     self.assertEqual(1, subject.hashCount)
Ejemplo n.º 3
0
 def testOneReadOneLandmarkGetSubjects(self):
     """
     If one subject with just one landmark (and hence no hashes) is added,
     an entry is appended to the database subject info.
     """
     dbParams = DatabaseParameters(landmarks=[AlphaHelix], trigPoints=[])
     db = Database(dbParams)
     db.addSubject(AARead('id', 'FRRRFRRRF'))
     subjects = list(db.getSubjects())
     self.assertEqual(1, len(subjects))
     subject = subjects[0]
     self.assertEqual(Subject(AARead('id', 'FRRRFRRRF')), subject)
     self.assertEqual(0, subject.hashCount)