Skip to content

Commit

Permalink
Test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Sep 28, 2021
1 parent f8ba8a2 commit cb00c31
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test-data/gene.bed
Expand Up @@ -8,4 +8,4 @@ track name="TilingArray" description="TilingArray demonstration" visibility=2 us
7 127477031 127478198 Neg2 400 - 127477031 127478198 0,0,255
7 127478198 127479365 Neg3 300 - 127478198 127479365 0,0,255
7 127479365 127480532 Pos5 1000 + 127479365 127480532 255,0,0
7 127480532 127481699 Neg4 0 - 127480532 127481699 0,0,255
7 127480532 127481699 Neg4 0 . 127480532 127481699 0,0,255
2 changes: 2 additions & 0 deletions test-data/gene.gff3
Expand Up @@ -7,6 +7,8 @@
#!genebuild-last-updated 2010-09
1 tair gene 3631 5899 . + . ID=gene:AT1G01010;Name=NAC001;biotype=protein_coding;description=NAC domain-containing protein 1 [Source:UniProtKB/Swiss-Prot%3BAcc:Q0WV96];gene_id=AT1G01010;logic_name=tair
1 tair transcript 3631 5899 . + . ID=transcript:AT1G01010.1;Parent=gene:AT1G01010;Name=ANAC001;biotype=protein_coding;transcript_id=AT1G01010.1
1 tair transcript 3632 5900 . - . ID=transcript:AT1G01010.2;Parent=gene:AT1G01010;Name=ANAC002;biotype=protein_coding;transcript_id=AT1G01010.2
1 tair transcript 3633 5901 . . . ID=transcript:AT1G01010.3;Parent=gene:AT1G01010;Name=ANAC003;biotype=protein_coding;transcript_id=AT1G01010.3
1 tair five_prime_UTR 3631 3759 . + . Parent=transcript:AT1G01010.1
1 tair exon 3631 3913 . + . Parent=transcript:AT1G01010.1;Name=AT1G01010.1.exon1;constitutive=1;ensembl_end_phase=1;ensembl_phase=-1;exon_id=AT1G01010.1.exon1;rank=1
1 tair CDS 3760 3913 . + 0 ID=CDS:AT1G01010.1;Parent=transcript:AT1G01010.1;protein_id=AT1G01010.1
Expand Down
2 changes: 1 addition & 1 deletion test-data/transcripts.tsv
Expand Up @@ -8,4 +8,4 @@ AT1G33615 label_AT1G33615 Arabidopsis_thaliana na At1 12193325 12194374 ncRNA_ge
AT5G41905 label_AT5G41905 Arabidopsis_thaliana MIR166E At5 16775524 16775658 miRNA_gene minus miRNA MIR166/MIR166E%3B_miRNA_[Source:TAIR%3BAcc:AT5G41905] 07/01/2000
AT1G57800 label_AT1G57800 Arabidopsis_thaliana ORTH3 At1 21408623 21412283 gene minus protein_coding E3_ubiquitin-protein_ligase_ORTHRUS_3_[Source:UniProtKB/Swiss-Prot%3BAcc:Q9FVS2] 08/01/2000
AT1G49500 label_AT1G49500 Arabidopsis_thaliana na At1 18321295 18322284 gene minus protein_coding unknown_protein%3B_FUNCTIONS_IN:_molecular_function_unknown%3B_INVOLVED_IN:_biological_process_unknown%3B_LOCATED_IN:_endomembrane_system%3B_EXPRESSED_IN:_19_plant_structures%3B_EXPRESSED_DURING:_10_growth_stages%3B_BEST_Arabidopsis_thaliana_protein_match_is:_u_/.../_protein_(TAIR:AT3G19030.1)%3B_Has_24_Blast_hits_to_24_proteins_in_2_species:_Archae_-_0%3B_Bacteria_-_0%3B_Metazoa_-_0%3B_Fungi_-_0%3B_Plants_-_24%3B_Viruses_-_0%3B_Other_Eukaryotes_-_0_(source:_NCBI_BLink)._[Source:TAIR%3BAcc:AT1G49500] 09/01/2000
AT5G35334 label_AT5G35334 Arabidopsis_thaliana na At5 13537917 13538984 gene plus transposable_element transposable_element_gene_[Source:TAIR%3BAcc:AT5G35334] 10/01/2000
AT5G35334 label_AT5G35334 Arabidopsis_thaliana na At5 13537917 13538984 gene transposable_element transposable_element_gene_[Source:TAIR%3BAcc:AT5G35334] 10/01/2000
16 changes: 16 additions & 0 deletions tests/results/abstraction.json
Expand Up @@ -35,13 +35,21 @@
"label": "plus",
"uri": "http://askomics.org/test/data/plus"
},
{
"label": "unknown/both",
"uri": "http://askomics.org/test/data/unknown/both"
},
{
"label": "+",
"uri": "http://askomics.org/test/data/%2B"
},
{
"label": "-",
"uri": "http://askomics.org/test/data/-"
},
{
"label": ".",
"uri": "http://askomics.org/test/data/."
}
],
"entityUri": "http://askomics.org/test/data/gene",
Expand All @@ -65,13 +73,21 @@
"label": "plus",
"uri": "http://askomics.org/test/data/plus"
},
{
"label": "unknown/both",
"uri": "http://askomics.org/test/data/unknown/both"
},
{
"label": "+",
"uri": "http://askomics.org/test/data/%2B"
},
{
"label": "-",
"uri": "http://askomics.org/test/data/-"
},
{
"label": ".",
"uri": "http://askomics.org/test/data/."
}
],
"entityUri": "http://askomics.org/test/data/transcript",
Expand Down
6 changes: 6 additions & 0 deletions tests/results/preview.json
Expand Up @@ -38,6 +38,12 @@
},
{
"transcript1_Label": "AT1G01010.1"
},
{
"transcript1_Label": "AT1G01010.2"
},
{
"transcript1_Label": "AT1G01010.3"
}
]
}
2 changes: 1 addition & 1 deletion tests/results/preview_files.json
Expand Up @@ -153,7 +153,7 @@
"featureName": "na",
"featureType": "gene",
"start": "13537917",
"strand": "plus",
"strand": "",
"taxon": "Arabidopsis_thaliana",
"transcript": "AT5G35334",
"date": "10/01/2000",
Expand Down
2 changes: 1 addition & 1 deletion tests/results/results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/results/results_admin.json
Expand Up @@ -7,7 +7,7 @@
"end": ###END###,
"execTime": ###EXECTIME###,
"id": ###ID###,
"nrows": 11,
"nrows": 13,
"public": ###PUBLIC###,
"size": ###SIZE###,
"start": ###START###,
Expand Down
2 changes: 1 addition & 1 deletion tests/results/results_form.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/test_api_admin.py
Expand Up @@ -68,7 +68,7 @@ def test_get_files(self, client):
'date': info["transcripts"]["upload"]["file_date"],
'id': 1,
'name': 'transcripts.tsv',
'size': 2268,
'size': 2264,
'type': 'csv/tsv',
'user': 'jsmith'

Expand All @@ -92,7 +92,7 @@ def test_get_files(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3',
'user': 'jsmith'

Expand Down Expand Up @@ -443,7 +443,7 @@ def test_delete_files(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3',
'user': 'jsmith'

Expand Down
14 changes: 7 additions & 7 deletions tests/test_api_file.py
Expand Up @@ -25,7 +25,7 @@ def test_get_files(self, client):
'date': info["transcripts"]["upload"]["file_date"],
'id': 1,
'name': 'transcripts.tsv',
'size': 2268,
'size': 2264,
'type': 'csv/tsv'
}, {
'date': info["de"]["upload"]["file_date"],
Expand All @@ -43,7 +43,7 @@ def test_get_files(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3'
}, {
'date': info["bed"]["upload"]["file_date"],
Expand Down Expand Up @@ -73,7 +73,7 @@ def test_get_files(self, client):
'date': info["transcripts"]["upload"]["file_date"],
'id': 1,
'name': 'transcripts.tsv',
'size': 2268,
'size': 2264,
'type': 'csv/tsv'
}]
}
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_edit_file(self, client):
'date': info["transcripts"]["upload"]["file_date"],
'id': 1,
'name': 'new name.tsv',
'size': 2268,
'size': 2264,
'type': 'csv/tsv'
}, {
'date': info["de"]["upload"]["file_date"],
Expand All @@ -123,7 +123,7 @@ def test_edit_file(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3'
}, {
'date': info["bed"]["upload"]["file_date"],
Expand Down Expand Up @@ -438,7 +438,7 @@ def test_delete_files(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3'
}, {
'date': info["bed"]["upload"]["file_date"],
Expand All @@ -464,7 +464,7 @@ def test_delete_files(self, client):
'date': info["gene"]["upload"]["file_date"],
'id': 4,
'name': 'gene.gff3',
'size': 2267,
'size': 2555,
'type': 'gff/gff3'
}, {
'date': info["bed"]["upload"]["file_date"],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_query.py
Expand Up @@ -153,7 +153,7 @@ def test_get_preview(self, client):
client.log_user("jdoe")

response = client.client.post('/api/query/preview', json=data)
expected = {'error': False, 'errorMessage': '', 'headerPreview': ['transcript1_Label'], 'resultsPreview': [{'transcript1_Label': 'label_AT1G57800'}, {'transcript1_Label': 'label_AT5G35334'}, {'transcript1_Label': 'label_AT3G10460'}, {'transcript1_Label': 'label_AT1G49500'}, {'transcript1_Label': 'label_AT3G10490'}, {'transcript1_Label': 'label_AT3G51470'}, {'transcript1_Label': 'label_AT5G41905'}, {'transcript1_Label': 'label_AT1G33615'}, {'transcript1_Label': 'label_AT3G22640'}, {'transcript1_Label': 'label_AT3G13660'}, {'transcript1_Label': 'AT1G01010.1'}]}
expected = {'error': False, 'errorMessage': '', 'headerPreview': ['transcript1_Label'], 'resultsPreview': [{'transcript1_Label': 'label_AT1G57800'}, {'transcript1_Label': 'label_AT5G35334'}, {'transcript1_Label': 'label_AT3G10460'}, {'transcript1_Label': 'label_AT1G49500'}, {'transcript1_Label': 'label_AT3G10490'}, {'transcript1_Label': 'label_AT3G51470'}, {'transcript1_Label': 'label_AT5G41905'}, {'transcript1_Label': 'label_AT1G33615'}, {'transcript1_Label': 'label_AT3G22640'}, {'transcript1_Label': 'label_AT3G13660'}, {'transcript1_Label': 'AT1G01010.1'}, {'transcript1_Label': 'AT1G01010.2'}, {'transcript1_Label': 'AT1G01010.3'}]}

# print(response.json)

Expand Down

0 comments on commit cb00c31

Please sign in to comment.