-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_cases.py
170 lines (119 loc) · 5.33 KB
/
test_cases.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
from dsl import *
# Test Case 1
input1 = '<packagedElement visibility="public"></packagedElement>'
output1 = '<packagedElement></packagedElement>'
test_case_1 = [({"input": xml_to_dsl(input1)}, xml_to_dsl(output1))]
# Test Case 2
input2 = '<packagedElement></packagedElement>'
output2 = '<packagedElement visibility="public"></packagedElement>'
test_case_2 = [({"input": xml_to_dsl(input2)}, xml_to_dsl(output2))]
# Test Case 3
input3 = '''
<ownedComment>
<body>This is body d4143d60.</body>
</ownedComment>
'''
output3 = '<ownedComment body="This is body d4143d60." />'
test_case_3 = [({"input": xml_to_dsl(input3)}, xml_to_dsl(output3))]
# Test Case 4
input4 = '<ownedComment body="This is body d4143d60." />'
output4 = '''
<ownedComment>
<body>This is body d4143d60.</body>
</ownedComment>
'''
test_case_4 = [({"input": xml_to_dsl(input4)}, xml_to_dsl(output4))]
# Test Case 5
input5 = '''
<packagedElement id="_YuRb">
<ownedComment>
<body>This is body d4143d60.</body>
</ownedComment>
</packagedElement>
'''
output5 = '''
<packagedElement id="_YuRb" >
<ownedComment body="This is body d4143d60." />
</packagedElement>
'''
test_case_5 = [({"input": xml_to_dsl(input5)}, xml_to_dsl(output5))]
# Test Case 6
input6 = '<packagedElement name="TempClass1" visibility="public"></packagedElement>'
output6 = '<packagedElement name="TempClass1"></packagedElement>'
test_case_6 = [({"input": xml_to_dsl(input6)}, xml_to_dsl(output6))]
# Test Case 7
input7 = '<packagedElement name="TempClass1"></packagedElement>'
output7 = '<packagedElement name="TempClass1" visibility="public"></packagedElement>'
test_case_7 = [({"input": xml_to_dsl(input7)}, xml_to_dsl(output7))]
# Test Case 8
input8 = '<packagedElement type="uml:Class" id="_383A" name="TempClass1"></packagedElement>'
output8 = '<packagedElement type="uml:Class" id="_383A" name="TempClass1" visibility="public"></packagedElement>'
test_case_8 = [({"input": xml_to_dsl(input8)}, xml_to_dsl(output8))]
# Test Case 9
input9 = '''
<ownedComment annotatedElement="_383A">
<body>This is body d4143d60.</body>
</ownedComment>
'''
output9 = '<ownedComment annotatedElement="_383A" body="This is body d4143d60." />'
test_case_9 = [({"input": xml_to_dsl(input9)}, xml_to_dsl(output9))]
# Test Case 10
input10 = '''
<packagedElement type="uml:Class" id="_383A">
<ownedComment annotatedElement="_383A">
<body>This is body d4143d60.</body>
</ownedComment>
</packagedElement>
'''
output10 = '''
<packagedElement type="uml:Class" id="_383A" >
<ownedComment annotatedElement="_383A" body="This is body d4143d60." />
</packagedElement>
'''
test_case_10 = [({"input": xml_to_dsl(input10)}, xml_to_dsl(output10))]
# Test Case 11
input11 = '<ownedComment id="_YuRb" body="This is body d4143d60." annotatedElement="_383A" />'
output11 = '''
<ownedComment id="_YuRb" annotatedElement="_383A">
<body>This is body d4143d60.</body>
</ownedComment>
'''
test_case_11 = [({"input": xml_to_dsl(input11)}, xml_to_dsl(output11))]
# Test Case 12
input12 = '''
<packagedElement type="uml:Class" id="_383A" name="TempClass1">
<ownedComment id="_YuRb" annotatedElement="_383A">
<body>This is body d4143d60.</body>
</ownedComment>
</packagedElement>
'''
output12 = '''
<packagedElement type="uml:Class" id="_383A" name="TempClass1" visibility="public">
<ownedComment id="_YuRb" body="This is body d4143d60." annotatedElement="_383A" />
</packagedElement>
'''
test_case_12 = [({"input": xml_to_dsl(input12)}, xml_to_dsl(output12))]
# input13 = '''
# <packagedElement type="uml:Class" id="_383A" name="TempClass1">
# <eAnnotations id="_0-3eZeRbEduVs91jndUPVw" source="http://www.eclipse.org/uml2/2.0.0/UML">
# <details id="_0-3eZuRbEduVs91jndUPVw" key="entity" />
# </eAnnotations>
# <ownedComment id="_YuRb" annotatedElement="_383A">
# <body>This is body d4143d60.</body>
# </ownedComment>
# <ownedAttribute id="_383AC7D3023A40C0CEBF005E" name="TempAttrib1" visibility="private" />
# <ownedAttribute id="_383AC7D3023A40C0CE9C0271" name="TempAttrib2"
# visibility="public" type="_383AC7D3023A40C0CAFC0106" isUnique="false" aggregation="shared"
# association="_383AC7D3023A40C0CE9B034C" />
# </packagedElement>
# '''
# output13 = '''
# <packagedElement type="uml:Class" id="_383A" name="TempClass1" visibility="public">
# <ownedComment id="_YuRb" body="This is body d4143d60." annotatedElement="_383A" />
# <ownedAttribute id="_383AC7D3023A40C0CEBF005E" visibility="private" name="TempAttrib1" />
# <ownedAttribute id="_383AC7D3023A40C0CE9C0271" visibility="public"
# name="TempAttrib2" isUnique="false" aggregation="shared"
# type="_383AC7D3023A40C0CAFC0106" association="_383AC7D3023A40C0CE9B034C" />
# </packagedElement>
# '''
# test_case_13 = [({"input": xml_to_dsl(input13)}, xml_to_dsl(output13))]