Beispiel #1
0
 def test_define_path_no_info(self):
     """ """
     # Define inputs
     outdir = '/test/'
     namespace = 'BIDS'
     f = {'test': {'test2': 'abcdef'}}
     # Call function
     path = export_bids.define_path(outdir, f, namespace)
     # Assert path is empty string
     self.assertEqual(path, '')
Beispiel #2
0
 def test_define_path_namespace_is_NA(self):
     """ """
     # Define inputs
     outdir = '/test/'
     namespace = 'BIDS'
     f = {'info': {namespace: 'NA'}}
     # Call function
     path = export_bids.define_path(outdir, f, namespace)
     # Assert path is empty string
     self.assertEqual(path, '')
Beispiel #3
0
 def test_define_path_empty_filename(self):
     """ """
     # Define inputs
     outdir = '/test/'
     namespace = 'BIDS'
     f = {
         'info': {
             namespace: {
                 'Path': '/this/is/the/path',
                 'Folder': 'path',
                 'Filename': ''
             }
         }
     }
     # Call function
     path = export_bids.define_path(outdir, f, namespace)
     # Assert path is empty string
     self.assertEqual(path, '')
Beispiel #4
0
 def test_define_path_valid(self):
     """ """
     # Define inputs
     outdir = '/test/'
     namespace = 'BIDS'
     f = {
         'info': {
             namespace: {
                 'Path': '',
                 'Folder': '/',
                 'Filename': 'test.json'
             }
         }
     }
     # Call function
     path = export_bids.define_path(outdir, f, namespace)
     # Assert path is as expected
     self.assertEqual(path, '/test/test.json')