コード例 #1
0
ファイル: test_database.py プロジェクト: acorg/light-matter
 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()))
コード例 #2
0
ファイル: test_database.py プロジェクト: acorg/light-matter
 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)
コード例 #3
0
ファイル: test_database.py プロジェクト: acorg/light-matter
 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)