Skip to content

Commit

Permalink
Target Gene Test Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bencap committed Nov 4, 2024
1 parent a284673 commit 5809ba4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/view_models/test_target_gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def test_create_target_gene_with_sequence():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 1}]
target_sequence = {
"sequenceType": "dna",
Expand Down Expand Up @@ -37,12 +37,12 @@ def test_create_target_gene_with_sequence():
target_sequence=target_sequence,
)
assert externalIdentifier.name == "UBE2I"
assert externalIdentifier.category == "Regulatory"
assert externalIdentifier.category == "regulatory"


def test_create_target_gene_with_accession():
name = "BRCA1"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 1}]
target_accession = {"accession": "NM_001637.3", "assembly": "GRCh37", "gene": "BRCA1"}
externalIdentifier = TargetGeneCreate(
Expand All @@ -52,7 +52,7 @@ def test_create_target_gene_with_accession():
target_accession=target_accession,
)
assert externalIdentifier.name == "BRCA1"
assert externalIdentifier.category == "Regulatory"
assert externalIdentifier.category == "regulatory"


def test_create_invalid_category():
Expand Down Expand Up @@ -91,14 +91,14 @@ def test_create_invalid_category():
target_sequence=target_sequence,
)
assert (
"invalid name is not a valid target category. Valid categories are Protein coding, Regulatory, and Other"
" noncoding" in str(exc_info.value)
"value is not a valid enumeration member; permitted: 'protein_coding', 'regulatory', 'other_noncoding'"
in str(exc_info.value)
)


def test_create_invalid_sequence_type():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 0}]
taxonomy = {
"taxId": 9606,
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_create_invalid_sequence_type():

def test_create_not_match_sequence_and_type():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 0}]
target_sequence = {"sequenceType": "dna", "sequence": "ARCG"}
taxonomy = {
Expand All @@ -163,7 +163,7 @@ def test_create_not_match_sequence_and_type():

def test_create_invalid_sequence():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 0}]
target_sequence = {"sequenceType": "dna", "sequence": "AOCG%"}
taxonomy = {
Expand All @@ -190,7 +190,7 @@ def test_create_invalid_sequence():

def test_cant_create_target_gene_without_sequence_or_accession():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 1}]
with pytest.raises(ValueError) as exc_info:
TargetGeneCreate(
Expand All @@ -204,7 +204,7 @@ def test_cant_create_target_gene_without_sequence_or_accession():

def test_cant_create_target_gene_with_both_sequence_and_accession():
name = "UBE2I"
category = "Regulatory"
category = "regulatory"
external_identifiers = [{"identifier": {"dbName": "Ensembl", "identifier": "ENSG00000103275"}, "offset": 1}]
target_accession = {"accession": "NM_001637.3", "assembly": "GRCh37", "gene": "BRCA1"}
target_sequence = {
Expand Down

0 comments on commit 5809ba4

Please sign in to comment.