mirror of
https://github.com/docling-project/docling-core.git
synced 2026-05-17 13:10:44 +00:00
test(Doclang): add chart serialization test (#498)
Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
This commit is contained in:
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
<doclang version="1.0.0">
|
||||
<page_header>
|
||||
<location value="73"/>
|
||||
<location value="14"/>
|
||||
<location value="222"/>
|
||||
<location value="20"/>
|
||||
Probability, Combinatorics and Control
|
||||
</page_header>
|
||||
<floating_group class="picture">
|
||||
<picture>
|
||||
<meta>
|
||||
<classification>Bar chart</classification>
|
||||
</meta>
|
||||
<location value="104"/>
|
||||
<location value="38"/>
|
||||
<location value="401"/>
|
||||
<location value="152"/>
|
||||
<otsl>
|
||||
<fcel/>
|
||||
Number of impellers
|
||||
<fcel/>
|
||||
single-frequency
|
||||
<fcel/>
|
||||
multi-frequency
|
||||
<nl/>
|
||||
<fcel/>
|
||||
1
|
||||
<fcel/>
|
||||
0.06
|
||||
<fcel/>
|
||||
0.16
|
||||
<nl/>
|
||||
<fcel/>
|
||||
2
|
||||
<fcel/>
|
||||
0.12
|
||||
<fcel/>
|
||||
0.26
|
||||
<nl/>
|
||||
<fcel/>
|
||||
3
|
||||
<fcel/>
|
||||
0.16
|
||||
<fcel/>
|
||||
0.27
|
||||
<nl/>
|
||||
<fcel/>
|
||||
4
|
||||
<fcel/>
|
||||
0.14
|
||||
<fcel/>
|
||||
0.26
|
||||
<nl/>
|
||||
<fcel/>
|
||||
5
|
||||
<fcel/>
|
||||
0.16
|
||||
<fcel/>
|
||||
0.25
|
||||
<nl/>
|
||||
<fcel/>
|
||||
6
|
||||
<fcel/>
|
||||
0.24
|
||||
<fcel/>
|
||||
0.24
|
||||
<nl/>
|
||||
</otsl>
|
||||
</picture>
|
||||
</floating_group>
|
||||
</doclang>
|
||||
@@ -677,3 +677,13 @@ def test_def_prov_256():
|
||||
ser_txt = ser_res.text
|
||||
exp_file = Path("./test/data/doc/simple_prov_res_256.out.dclg.xml")
|
||||
verify(exp_file=exp_file, actual=ser_txt)
|
||||
|
||||
def test_chart():
|
||||
doc = DoclingDocument.load_from_json("./test/data/doc/barchart.json")
|
||||
ser = DoclangDocSerializer(
|
||||
doc=doc,
|
||||
)
|
||||
ser_res = ser.serialize()
|
||||
ser_txt = ser_res.text
|
||||
exp_file = Path("./test/data/doc/barchart.out.dclg.xml")
|
||||
verify(exp_file=exp_file, actual=ser_txt)
|
||||
|
||||
Reference in New Issue
Block a user