66import presalytics
77import io
88import lxml
9- from test import get_test_client
9+ from presalytics . client . api import get_client
1010if typing .TYPE_CHECKING :
1111 from presalytics .client .presalytics_story import Story , OoxmlDocument
1212 from presalytics .client .presalytics_ooxml_automation .models import ChartChartDataDTO , TableTableDataDTO
@@ -29,11 +29,11 @@ def test_xml_widget(self):
2929 test_file = os .path .join (os .path .dirname (__file__ ), "files" , "star.pptx" )
3030 tmp_filename = os .path .join (os .path .dirname (__file__ ), os .path .basename (test_file ))
3131 shutil .copyfile (test_file , tmp_filename )
32- client_info = get_test_client ().get_client_info ()
32+ client_info = get_client ().get_client_info ()
3333 story = presalytics .create_story_from_ooxml_file (tmp_filename , client_info = client_info )
3434 outline = presalytics .StoryOutline .load (story .outline )
3535 old_widget = outline .pages [0 ].widgets [0 ]
36- childs = get_test_client ().ooxml_automation .documents_childobjects_get_id (old_widget .data ["document_ooxml_id" ])
36+ childs = get_client ().ooxml_automation .documents_childobjects_get_id (old_widget .data ["document_ooxml_id" ])
3737 endpoint_map = presalytics .OoxmlEndpointMap .shape ()
3838 object_type = endpoint_map .get_object_type ()
3939 info = next (x for x in childs if x .object_type == object_type )
@@ -66,7 +66,7 @@ def test_xml_widget(self):
6666
6767 presalytics .COMPONENTS .register (widget )
6868 story .outline = outline .dump ()
69- get_test_client ().story .story_id_put (story .id , story )
69+ get_client ().story .story_id_put (story .id , story )
7070 html = presalytics .Revealer (outline ).package_as_standalone ().decode ('utf-8' )
7171 self .assertIsInstance (html , str )
7272 os .remove (tmp_filename )
@@ -88,7 +88,7 @@ def test_bytesio_upload(self):
8888 with open (test_file , 'rb' ) as f :
8989 _bytes = io .BytesIO (f .read ())
9090
91- story = presalytics .story_post_file_bytes (get_test_client (), _bytes , "testfile.pptx" )
91+ story = presalytics .story_post_file_bytes (get_client (), _bytes , "testfile.pptx" )
9292 from presalytics .client .presalytics_story .models .story import Story
9393 self .assertIsInstance (story , Story )
9494
@@ -121,10 +121,10 @@ def test_chart_update(self):
121121 document : "OoxmlDocument"
122122
123123 test_file = os .path .join (os .path .dirname (__file__ ), "files" , "bubblechart.pptx" )
124- story = get_test_client ().story .story_post_file (file = [test_file ])
125- story_detailed = get_test_client ().story .story_id_get (story .id , include_relationships = True )
124+ story = get_client ().story .story_post_file (file = [test_file ])
125+ story_detailed = get_client ().story .story_id_get (story .id , include_relationships = True )
126126 document = story_detailed .ooxml_documents [0 ]
127- object_tree = get_test_client ().ooxml_automation .documents_childobjects_get_id (document .ooxml_automation_id )
127+ object_tree = get_client ().ooxml_automation .documents_childobjects_get_id (document .ooxml_automation_id )
128128 endpoint_map = presalytics .OoxmlEndpointMap .chart ()
129129 object_type = endpoint_map .get_object_type ()
130130 chart_id = next (entity .entity_id for entity in object_tree if entity .object_type == object_type )
@@ -167,10 +167,10 @@ def test_table_update(self):
167167 dto : "TableTableDataDTO"
168168
169169 test_file = os .path .join (os .path .dirname (__file__ ), "files" , "table.pptx" )
170- story = get_test_client ().story .story_post_file (file = [test_file ])
171- story_detailed = get_test_client ().story .story_id_get (story .id , include_relationships = True )
170+ story = get_client ().story .story_post_file (file = [test_file ])
171+ story_detailed = get_client ().story .story_id_get (story .id , include_relationships = True )
172172 document = story_detailed .ooxml_documents [0 ]
173- object_tree = get_test_client ().ooxml_automation .documents_childobjects_get_id (document .ooxml_automation_id )
173+ object_tree = get_client ().ooxml_automation .documents_childobjects_get_id (document .ooxml_automation_id )
174174 endpoint_map = presalytics .OoxmlEndpointMap .table ()
175175 object_type = endpoint_map .get_object_type ()
176176 table_id = next (entity .entity_id for entity in object_tree if entity .object_type == object_type )
0 commit comments