Skip to content

Commit

Permalink
fix #110
Browse files Browse the repository at this point in the history
  • Loading branch information
laowantong committed Feb 25, 2024
1 parent 29bf698 commit ceac046
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
</form>
</div>
<div id="navigation">
<a title="Voir le code sur GitHub." target="_blank" href="https://github.com/laowantong/mocodo">Mocodo 4.2.2</a>
<a title="Voir le code sur GitHub." target="_blank" href="https://github.com/laowantong/mocodo">Mocodo 4.2.3</a>
&nbsp;∙&nbsp;
<img class="inlineIcon"
src="web/png/basthon_play.png"
Expand Down
2 changes: 1 addition & 1 deletion mocodo/convert/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def map_mcd_layout_onto_mld(self, lines):
def may_retrieve_distant_leg_note(self, leg, attribute):
if leg.entity_bid in self.inheritance_parent_or_children_to_delete:
for d in self.relations[leg.entity.bid]["columns"]:
if d["attribute"] == attribute["attribute"] and d["adjacent_source"] == attribute["adjacent_source"]:
if all(d[k] == attribute[k] for k in ("attribute", "adjacent_source", "association_name")):
return d["leg_note"]
return leg.note

Expand Down
2 changes: 1 addition & 1 deletion mocodo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "4.2.2"
__version__ = "4.2.3"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mocodo"
version = "4.2.2"
version = "4.2.3"
description = "Modélisation Conceptuelle de Données. Nickel. Ni souris."
authors = ["Aristide Grange"]
license = "MIT"
Expand Down
18 changes: 18 additions & 0 deletions test/test_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,24 @@ def test_two_same_type_inheritances(self):
t = Relations(Mcd(source, params), params)
self.assertEqual(t.get_text(minimal_template), text)

def test_roles_with_inheritance(self):
# https://github.com/laowantong/mocodo/issues/110
source = """
Équipe: id équipe,nom équipe
Accueille, 11 Match, 0N [-hôte] Équipe
Reçoit, 11 Match, 0N [-visiteur] Équipe
Match: id match
Rencontre: id rencontre
/XT\\ Rencontre <- Match: type rencontre
"""
text = """
Équipe (_id équipe_, nom équipe)
Rencontre (_id rencontre_, type rencontre, id match, #hôte, #visiteur)
""".strip().replace(" ", "")
t = Relations(Mcd(source, params), params)
self.assertEqual(t.get_text(minimal_template), text)

if __name__ == '__main__':
unittest.main()

0 comments on commit ceac046

Please sign in to comment.