def test_outer_connect(self): with connect() as login: self.assertEqual(ls(self.test_proj, connection=login), self._subjects) # Check to see that the context hasn't been closed by the first # ls call self.assertEqual(ls(self.test_proj, connection=login), self._subjects)
def test_outer_connect(self): with connect() as mbi_xnat: self.assertEqual(ls(self.test_proj, connection=mbi_xnat), self._subjects) # Check to see that the context hasn't been closed by the first # ls call self.assertEqual(ls(self.test_proj, connection=mbi_xnat), self._subjects) self.assertRaises(AttributeError, ls, self.test_proj, connection=mbi_xnat)
def test_filtering(self): self.assertEqual( ls('{}_..._MR01'.format(self.test_proj), datatype='session', with_scans=['two'], without_scans=['source']), ['{}_{:03}_MR01'.format(self.test_proj, i) for i in (3, 4, 5)])
def test_scan_ls(self): self.assertEqual(ls('{}_001_MR01'.format(self.test_proj)), ['source', 'three', 'two'])
def test_list_subject(self): self.assertEqual(ls('{}_001'.format(self.test_proj)), ['{}_001_MR01'.format(self.test_proj)])
def test_ls(self): self.assertEqual(ls(self.test_proj), self._subjects)
from xnatutils import get_from_xml, put, get, ls # get_from_xml('./test/clia6071-20200709_125713.xml', '/Users/tclose/Desktop/temp', # server='xnat.sydney.edu.au') # put('TEST001_TESTMISC_MR01', 'test_file', # '/Users/tclose/Desktop/screen-shot.png', create_session=True, # overwrite=True) # get('S01_MR1', '/Users/tclose/Desktop/temp2', project_id='PIPELINETEST', # server='dev.xnat.sydney.edu.au') print( ls(subject_id='S01', project_id='PIPELINETEST', server='dev.xnat.sydney.edu.au'))