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()))
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)
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)