File tree Expand file tree Collapse file tree
tests/integration/reqif/SPEC-RELATION/01_escaping_long_name Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import html
12from typing import List , Optional
23
34from reqif .models .error_handling import ReqIFMissingTagException
@@ -96,7 +97,7 @@ def unparse(spec_relation: ReqIFSpecRelation):
9697 if spec_relation .last_change is not None :
9798 output += f' LAST-CHANGE="{ spec_relation .last_change } "'
9899 if spec_relation .long_name is not None :
99- output += f' LONG-NAME="{ spec_relation .long_name } "'
100+ output += f' LONG-NAME="{ html . escape ( spec_relation .long_name ) } "'
100101 output += ">\n "
101102
102103 children_tags : List [str ]
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <REQ-IF xmlns =" http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns : configuration =" http://eclipse.org/rmf/pror/toolextensions/1.0" >
3+ <CORE-CONTENT >
4+ <REQ-IF-CONTENT >
5+ <SPEC-RELATIONS >
6+ <SPEC-RELATION IDENTIFIER =" TEST_SPEC_RELATION_ID" LAST-CHANGE =" 2015-12-14T02:04:52.318+01:00" LONG-NAME =" Test & Test" >
7+ <TARGET >
8+ <SPEC-OBJECT-REF >SPEC_OBJECT_B</SPEC-OBJECT-REF >
9+ </TARGET >
10+ <SOURCE >
11+ <SPEC-OBJECT-REF >SPEC_OBJECT_A</SPEC-OBJECT-REF >
12+ </SOURCE >
13+ <TYPE >
14+ <SPEC-RELATION-TYPE-REF >PARENT</SPEC-RELATION-TYPE-REF >
15+ </TYPE >
16+ </SPEC-RELATION >
17+ </SPEC-RELATIONS >
18+ </REQ-IF-CONTENT >
19+ </CORE-CONTENT >
20+ </REQ-IF >
Original file line number Diff line number Diff line change 1+ RUN: mkdir -p %S/output
2+ RUN: %reqif passthrough %S/sample.reqif %S/output/sample.reqif
3+ RUN: %diff %S/sample.reqif %S/output/sample.reqif
You can’t perform that action at this time.
0 commit comments