Skip to content

Commit c617c67

Browse files
author
Humberto Sanchez II
committed
<Bug>[OglSDInstance]: <Incorrect height set>
[ * Also fix update deprecated calls * Update version for release ] [#29]
1 parent 00a2f3b commit c617c67

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name="untanglepyut",
13-
version="0.5.0",
13+
version="0.5.1",
1414
author_email='[email protected]',
1515
description='XML to Ogl Object Model',
1616
long_description=README,

tests/untanglepyut/TestUnTangleSequenceDiagram.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import List
2+
from typing import Tuple
23
from typing import cast
34

45
from logging import Logger
@@ -13,6 +14,8 @@
1314
from pyutmodel.PyutSDInstance import PyutSDInstance
1415
from pyutmodel.PyutSDMessage import PyutSDMessage
1516

17+
from ogl.sd.OglSDInstance import OglSDInstance
18+
1619
from untanglepyut.Types import OglSDInstances
1720
from untanglepyut.Types import OglSDMessages
1821

@@ -80,6 +83,18 @@ def testSequenceMessagePyutSDMessageIsCorrect(self):
8083
self.assertIsNotNone(pyutSrcInstance, 'Missing source sd instance')
8184
self.assertIsNotNone(pyutDstInstance, 'Missing source sd instance')
8285

86+
def testSDInstanceLifeLineIsCorrect(self):
87+
"""
88+
Verifies https://github.com/hasii2011/untanglepyut/issues/29
89+
"""
90+
document: Document = self._retrieveSequenceDiagramDocument()
91+
92+
sdInstances: OglSDInstances = document.oglSDInstances
93+
for sdInstance in sdInstances.values():
94+
oglSDInstance: OglSDInstance = cast(OglSDInstance, sdInstance)
95+
size: Tuple[int, int] = oglSDInstance.GetSize()
96+
self.assertEqual(OglSDInstance.DEFAULT_HEIGHT, size[1], 'Lifeline height is incorrect')
97+
8398
def _retrieveSequenceDiagramDocument(self) -> Document:
8499

85100
fqFileName: str = resource_filename(TestBase.RESOURCES_PACKAGE_NAME, 'SequenceDiagram.xml')

untanglepyut/UntangleSequenceDiagram.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def _untangleSDInstances(self, pyutDocument: Element) -> OglSDInstances:
7575
oglSDInstance: OglSDInstance = OglSDInstance(pyutSDInstance)
7676
graphicInfo: GraphicInformation = toGraphicInfo(graphicElement=graphicSDInstance)
7777

78-
oglSDInstance.SetSize(width=graphicInfo.width, height=graphicInfo.width)
78+
oglSDInstance.SetSize(width=graphicInfo.width, height=graphicInfo.height)
7979
oglSDInstance.SetPosition(x=graphicInfo.x, y=graphicInfo.y)
8080

8181
self._updateModel(oglObject=oglSDInstance, graphicInformation=graphicInfo)
@@ -96,8 +96,8 @@ def _untangleSDMessages(self, pyutDocument: Element) -> OglSDMessages:
9696
srcInstance: OglSDInstance = self._oglSDInstances[bogus.sourceId]
9797
dstInstance: OglSDInstance = self._oglSDInstances[bogus.destinationId]
9898

99-
pyutSDMessage.setSource(srcInstance.getPyutObject()) # Ugh, time was set by sdMessageToPyutSDMessage
100-
pyutSDMessage.setDestination(dstInstance.getPyutObject()) # This "split" functionality must be fixed
99+
pyutSDMessage.setSource(srcInstance.pyutObject) # Ugh, time was set by sdMessageToPyutSDMessage
100+
pyutSDMessage.setDestination(dstInstance.pyutObject) # This "split" functionality must be fixed
101101
oglSDMessage: OglSDMessage = OglSDMessage(srcShape=srcInstance, pyutSDMessage=pyutSDMessage, dstShape=dstInstance)
102102

103103
srcInstance.addLink(link=oglSDMessage)

0 commit comments

Comments
 (0)