forked from qiita-spots/qiita
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix qiita-spots#3300 * update populate_test_db.sql * fix errors * fix test_prep_template.py * fix test_setup.py * addressing @charles-cowart and @wasade comments
- Loading branch information
Showing
8 changed files
with
36 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -480,19 +480,10 @@ INSERT INTO qiita.analysis_users (analysis_id, email) VALUES (1, '[email protected] | |
INSERT INTO qiita.ontology (ontology_id, ontology, fully_loaded, fullname, query_url, source_url, definition, load_date) VALUES (999999999, E'ENA', E'1', E'European Nucleotide Archive Submission Ontology', NULL, E'http://www.ebi.ac.uk/embl/Documentation/ENA-Reads.html', E'The ENA CV is to be used to annotate XML submissions to the ENA.', '2009-02-23 00:00:00'); | ||
|
||
-- Add some ontology values | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508974, 999999999, E'Whole Genome Sequencing', E'ENA:0000059', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508974, 999999999, E'WGS', E'ENA:0000059', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508975, 999999999, E'Metagenomics', E'ENA:0000060', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508976, 999999999, E'Transcriptome Analysis', E'ENA:0000061', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508977, 999999999, E'Resequencing', E'ENA:0000062', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508978, 999999999, E'Epigenetics', E'ENA:0000066', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508979, 999999999, E'Synthetic Genomics', E'ENA:0000067', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508980, 999999999, E'Forensic or Paleo-genomics', E'ENA:0000065', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508981, 999999999, E'Gene Regulation Study', E'ENA:0000068', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508982, 999999999, E'Cancer Genomics', E'ENA:0000063', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508983, 999999999, E'Population Genomics', E'ENA:0000064', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508984, 999999999, E'RNASeq', E'ENA:0000070', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508985, 999999999, E'Exome Sequencing', E'ENA:0000071', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508986, 999999999, E'Pooled Clone Sequencing', E'ENA:0000072', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508976, 999999999, E'Amplicon', E'ENA:0000061', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508984, 999999999, E'RNA-Seq', E'ENA:0000070', NULL, NULL, NULL, NULL, NULL); | ||
INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, namespace, is_obsolete, is_root_term, is_leaf) VALUES (2052508987, 999999999, E'Other', E'ENA:0000069', NULL, NULL, NULL, NULL, NULL); | ||
|
||
-- Create the new sample_template_filepath | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,12 +38,7 @@ class TestPrepAPIReadOnly(TestCase): | |
def test_get_ENA_ontology(self): | ||
obs = _get_ENA_ontology() | ||
exp = { | ||
'ENA': ['Cancer Genomics', 'Epigenetics', 'Exome Sequencing', | ||
'Forensic or Paleo-genomics', 'Gene Regulation Study', | ||
'Metagenomics', 'Pooled Clone Sequencing', | ||
'Population Genomics', 'RNASeq', 'Resequencing', | ||
'Synthetic Genomics', 'Transcriptome Analysis', | ||
'Whole Genome Sequencing', 'Other'], | ||
'ENA': ['Amplicon', 'Metagenomics', 'RNA-Seq', 'WGS', 'Other'], | ||
'User': []} | ||
self.assertEqual(obs, exp) | ||
|
||
|
@@ -58,12 +53,7 @@ def test_new_prep_template_get_req(self): | |
'Multiomic', 'Proteomic', 'Transcriptomics', | ||
'Viromics'], | ||
'ontology': { | ||
'ENA': ['Cancer Genomics', 'Epigenetics', 'Exome Sequencing', | ||
'Forensic or Paleo-genomics', 'Gene Regulation Study', | ||
'Metagenomics', 'Pooled Clone Sequencing', | ||
'Population Genomics', 'RNASeq', 'Resequencing', | ||
'Synthetic Genomics', 'Transcriptome Analysis', | ||
'Whole Genome Sequencing', 'Other'], | ||
'ENA': ['Amplicon', 'Metagenomics', 'RNA-Seq', 'WGS', 'Other'], | ||
'User': []}} | ||
|
||
self.assertEqual(obs, exp) | ||
|
@@ -83,12 +73,7 @@ def test_prep_template_ajax_get_req(self): | |
'num_columns': 22, | ||
'investigation_type': 'Metagenomics', | ||
'ontology': { | ||
'ENA': ['Cancer Genomics', 'Epigenetics', | ||
'Exome Sequencing', 'Forensic or Paleo-genomics', | ||
'Gene Regulation Study', 'Metagenomics', | ||
'Pooled Clone Sequencing', 'Population Genomics', | ||
'RNASeq', 'Resequencing', 'Synthetic Genomics', | ||
'Transcriptome Analysis', 'Whole Genome Sequencing', | ||
'ENA': ['Amplicon', 'Metagenomics', 'RNA-Seq', 'WGS', | ||
'Other'], | ||
'User': []}, | ||
'artifact_attached': True, | ||
|
@@ -518,10 +503,10 @@ def test_prep_template_patch_req(self): | |
# Update investigation type | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'replace', '/%s/investigation_type' % pt.id, | ||
'Cancer Genomics') | ||
'RNA-Seq') | ||
exp = {'status': 'success', 'message': ''} | ||
self.assertEqual(obs, exp) | ||
self.assertEqual(pt.investigation_type, 'Cancer Genomics') | ||
self.assertEqual(pt.investigation_type, 'RNA-Seq') | ||
# Update prep template data | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'replace', '/%s/data' % pt.id, 'update.txt') | ||
|
@@ -551,7 +536,7 @@ def test_prep_template_patch_req(self): | |
# Operation not supported | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'add', '/1/investigation_type', | ||
'Cancer Genomics') | ||
'RNA-Seq') | ||
exp = {'status': 'error', | ||
'message': 'Operation "add" not supported. ' | ||
'Current supported operations: replace, remove', | ||
|
@@ -560,22 +545,22 @@ def test_prep_template_patch_req(self): | |
# Incorrect path parameter | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'replace', '/investigation_type', | ||
'Cancer Genomics') | ||
'RNA-Seq') | ||
exp = {'status': 'error', | ||
'message': 'Incorrect path parameter'} | ||
self.assertEqual(obs, exp) | ||
# Incorrect attribute | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'replace', '/1/other_attribute', | ||
'Cancer Genomics') | ||
'RNA-Seq') | ||
exp = {'status': 'error', | ||
'message': 'Attribute "other_attribute" not found. ' | ||
'Please, check the path parameter'} | ||
self.assertEqual(obs, exp) | ||
# User doesn't have access | ||
obs = prep_template_patch_req( | ||
'[email protected]', 'replace', '/%s/investigation_type' % pt.id, | ||
'Cancer Genomics') | ||
'RNA-Seq') | ||
exp = {'status': 'error', | ||
'message': 'User has insufficient permissions'} | ||
self.assertEqual(obs, exp) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters