Esempio n. 1
0
 def test_artifact_graph_get_req_ancestors(self):
     obs = artifact_graph_get_req(1, 'ancestors', '*****@*****.**')
     exp = {'status': 'success',
            'message': '',
            'edge_list': [],
            'node_labels': [(1, 'Raw data 1 - FASTQ')]}
     self.assertEqual(obs, exp)
Esempio n. 2
0
 def test_artifact_graph_get_req_ancestors(self):
     obs = artifact_graph_get_req(1, 'ancestors', '*****@*****.**')
     exp = {'status': 'success',
            'message': '',
            'edge_list': [],
            'node_labels': [(1, 'Raw data 1 - FASTQ')]}
     self.assertEqual(obs, exp)
Esempio n. 3
0
 def test_artifact_graph_get_req_no_access(self):
     obs = artifact_graph_get_req(1, 'ancestors', '*****@*****.**')
     exp = {
         'status': 'error',
         'message': 'User does not have access to study'
     }
     self.assertEqual(obs, exp)
Esempio n. 4
0
 def test_artifact_graph_get_req_descendants(self):
     obs = artifact_graph_get_req(1, 'descendants', '*****@*****.**')
     exp = {'status': 'success',
            'message': '',
            'node_labels': [(1, 'Raw data 1 - FASTQ'),
                            (3, 'Demultiplexed 2 - Demultiplexed'),
                            (2, 'Demultiplexed 1 - Demultiplexed'),
                            (4, 'BIOM - BIOM'),
                            (5, 'BIOM - BIOM'),
                            (6, 'BIOM - BIOM')],
            'edge_list': [(1, 3), (1, 2), (2, 5), (2, 4), (2, 6)]}
     self.assertEqual(obs['message'], exp['message'])
     self.assertEqual(obs['status'], exp['status'])
     self.assertItemsEqual(obs['node_labels'], exp['node_labels'])
     self.assertItemsEqual(obs['edge_list'], exp['edge_list'])
Esempio n. 5
0
 def test_artifact_graph_get_req_descendants(self):
     obs = artifact_graph_get_req(1, 'descendants', '*****@*****.**')
     exp = {'status': 'success',
            'message': '',
            'node_labels': [(1, 'Raw data 1 - FASTQ'),
                            (3, 'Demultiplexed 2 - Demultiplexed'),
                            (2, 'Demultiplexed 1 - Demultiplexed'),
                            (4, 'BIOM - BIOM'),
                            (5, 'BIOM - BIOM'),
                            (6, 'BIOM - BIOM')],
            'edge_list': [(1, 3), (1, 2), (2, 5), (2, 4), (2, 6)]}
     self.assertEqual(obs['message'], exp['message'])
     self.assertEqual(obs['status'], exp['status'])
     self.assertItemsEqual(obs['node_labels'], exp['node_labels'])
     self.assertItemsEqual(obs['edge_list'], exp['edge_list'])
Esempio n. 6
0
 def test_artifact_graph_get_req_bad_direction(self):
     obs = artifact_graph_get_req(1, 'WRONG', '*****@*****.**')
     exp = {'status': 'error', 'message': 'Unknown directon WRONG'}
     self.assertEqual(obs, exp)
Esempio n. 7
0
 def test_artifact_graph_get_req_no_access(self):
     obs = artifact_graph_get_req(1, 'ancestors', '*****@*****.**')
     exp = {'status': 'error',
            'message': 'User does not have access to study'}
     self.assertEqual(obs, exp)
Esempio n. 8
0
 def test_artifact_graph_get_req_bad_direction(self):
     obs = artifact_graph_get_req(1, 'WRONG', '*****@*****.**')
     exp = {'status': 'error', 'message': 'Unknown directon WRONG'}
     self.assertEqual(obs, exp)