11"""Module for testing the normalize endpoint."""
22import pytest
3- from ga4gh .vrs .dataproxy import SeqRepoDataProxy
4- from ga4gh .vrs .extras .translator import Translator
5- from variation .normalize import Normalize
3+ from variation .query import QueryHandler
64from variation .schemas .ga4gh_vrsatile import VariationDescriptor
7- from variation .to_vrs import ToVRS
8- from variation .main import normalize as normalize_get_response
9- from variation .main import translate as to_vrs_get_response
10- from variation .classifiers import Classify
11- from variation .tokenizers import Tokenize
12- from variation .validators import Validate
13- from variation .translators import Translate
14- from variation .data_sources import SeqRepoAccess , TranscriptMappings , \
15- UTA , MANETranscriptMappings
16- from variation .mane_transcript import MANETranscript
17- from variation .tokenizers import GeneSymbol
18- from variation .tokenizers .caches import AminoAcidCache
195from datetime import datetime
6+ from variation .main import normalize as normalize_get_response
7+ from variation .main import to_vrs as to_vrs_get_response
208import copy
219
2210
@@ -26,40 +14,13 @@ def test_normalize():
2614 class TestNormalize :
2715
2816 def __init__ (self ):
29- tokenizer = Tokenize ()
30- classifier = Classify ()
31- seqrepo_access = SeqRepoAccess ()
32- transcript_mappings = TranscriptMappings ()
33- gene_symbol = GeneSymbol ()
34- amino_acid_cache = AminoAcidCache ()
35- uta = UTA ()
36- mane_transcript_mappings = MANETranscriptMappings ()
37- dp = SeqRepoDataProxy (seqrepo_access .seq_repo_client )
38- tlr = Translator (data_proxy = dp )
39- mane_transcript = MANETranscript (seqrepo_access ,
40- transcript_mappings ,
41- mane_transcript_mappings , uta )
42- validator = Validate (seqrepo_access , transcript_mappings ,
43- gene_symbol , mane_transcript , uta ,
44- dp , tlr , amino_acid_cache )
45- translator = Translate ()
46-
47- self .to_vrs = ToVRS (tokenizer , classifier , seqrepo_access ,
48- transcript_mappings , gene_symbol ,
49- amino_acid_cache , uta ,
50- mane_transcript_mappings , mane_transcript ,
51- validator , translator )
52- self .test_normalize = Normalize (seqrepo_access , uta )
17+ self .query_handler = QueryHandler ()
18+
19+ def to_vrs (self , q ):
20+ return self .query_handler .to_vrs (q )
5321
5422 def normalize (self , q ):
55- validations , warnings = self .to_vrs .get_validations (
56- q , normalize_endpoint = True
57- )
58- resp = \
59- self .test_normalize .normalize (q ,
60- validations ,
61- warnings )
62- return resp
23+ return self .query_handler .normalize (q )
6324
6425 return TestNormalize ()
6526
0 commit comments