def should_set_subject_datatype_property(self, xnatProject): import_project(self.dsc, xnatProject, importProjectTree=True) ctx = self.dsc.getContext() for subjectID in xnatProject.subjects().get(): sources = ctx.getSources(subjectID) s = xnatProject.subject(subjectID) eq_(1, len(sources)) eq_(sources[0].getOwnerProperty(DATATYPE_PROPERTY), xnat_api(s.datatype))
def should_import_all_subjects_for_project(self, xnatProject): import_project(self.dsc, xnatProject, importProjectTree=True) ctx = self.dsc.getContext() for subjectID in xnatProject.subjects().get(): sources = ctx.getSources(subjectID) s = xnatProject.subject(subjectID) eq_(1, len(sources)) eq_(sources[0].getOwnerProperty('xnat:subjectURI'), s._uri)
def should_import_resources(self, xnatProject): project = import_project(self.dsc, xnatProject, importProjectTree=False) xnat = xnatProject._intf files = entity_resource_files(xnatProject) self.assertEqual(len(project.getResourceNames()), len(list(files)))
def should_import_keywords(self, xnatProject): project = import_project(self.dsc, xnatProject, importProjectTree=False) tags = entity_keywords(xnatProject) actualTags = project.getTags() for tag in tags: self.assertIn(tag, actualTags)
def _import_first_project(self): self.xnat = self._xnat_connection() xnatProject = self.xnat.select.project('IGT_FMRI_NEURO') projectURI = import_project(self.dsc, xnatProject, importProjectTree=False).getURI() return (xnatProject,projectURI)