1- import math
1+ import io
22import os
33
44import hpotk
5- import pandas as pd
65import pytest
76
8- from gpsea .analysis import StatisticResult
97from gpsea .analysis .pcats import HpoTermAnalysisResult
10- from gpsea .analysis .pcats .stats import FisherExactTest
11- from gpsea .analysis .clf import GenotypeClassifier , HpoClassifier
12- from gpsea .analysis .mtc_filter import PhenotypeMtcResult
13- from gpsea .model import Cohort
8+ from gpsea .model import Cohort , ProteinMetadata
149from gpsea .view import (
1510 CohortViewer ,
1611 CohortVariantViewer ,
12+ GpseaReport ,
1713 MtcStatsViewer ,
18- summarize_hpo_analysis ,
1914)
15+ from gpsea .view ._viewers import ProteinVariantViewer
2016
2117
2218@pytest .mark .skip ("Just for manual testing and debugging" )
@@ -86,3 +82,29 @@ def test_process(
8682 report = stats_viewer .process (result = hpo_term_analysis_result )
8783 with open ("mtc_stats.html" , "w" ) as fh :
8884 report .write (fh )
85+
86+
87+ class TestProteinVariantViewer :
88+
89+ @pytest .fixture (scope = "class" )
90+ def protein_variant_viewer (
91+ self ,
92+ suox_protein_metadata : ProteinMetadata ,
93+ ) -> ProteinVariantViewer :
94+ return ProteinVariantViewer (
95+ protein_metadata = suox_protein_metadata ,
96+ )
97+
98+ def test_process (
99+ self ,
100+ suox_cohort : Cohort ,
101+ protein_variant_viewer : ProteinVariantViewer ,
102+ ):
103+ report = protein_variant_viewer .process (suox_cohort )
104+ assert isinstance (report , GpseaReport )
105+
106+ buf = io .StringIO ()
107+ report .write (buf )
108+ val = buf .getvalue ()
109+
110+ assert "gpsea-body" in val
0 commit comments