コード例 #1
0
 def test_convert_study(self):
     model = create_stub_study()
     converted_model = convert_to_sqlalchemy_model(model)  # type: SQLAlchemyStudy
     self.assertEqual(converted_model.__class__, SQLAlchemyStudy)
     self.assertEqual(converted_model.internal_id, INTERNAL_ID)
     self.assertEqual(converted_model.name, NAME)
     self.assertEqual(converted_model.accession_number, ACCESSION_NUMBER)
     self.assertEqual(converted_model.study_type, STUDY_TYPE)
     self.assertEqual(converted_model.description, DESCRIPTION)
     self.assertEqual(converted_model.study_title, STUDY_TITLE)
     self.assertEqual(converted_model.study_visibility, STUDY_VISIBILITY)
     self.assertEqual(converted_model.faculty_sponsor, FACULTY_SPONSOR)
コード例 #2
0
 def _create_model(self) -> InternalIdModel:
     return create_stub_study()
コード例 #3
0
 def _get_associated_with_instance(self, internal_id=None) -> InternalIdModel:
     study = create_stub_study()
     if internal_id is not None:
         study.internal_id = internal_id
     return study
コード例 #4
0
 def _create_model(self) -> InternalIdModel:
     return create_stub_study()
コード例 #5
0
 def _get_associated_with_instance(self,
                                   internal_id=None) -> InternalIdModel:
     study = create_stub_study()
     if internal_id is not None:
         study.internal_id = internal_id
     return study