summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-04-21 17:06:33 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2010-04-21 17:06:33 +0200
commitde01368cd06daad1ef259852abaad4c25bb0a468 (patch)
tree8171149eeed6e16bd2037af39ec8360123519e2b
parentade06ea6eedf84f33f705d0120060bb109fe5d65 (diff)
downloadpylint-de01368cd06daad1ef259852abaad4c25bb0a468.tar.gz
pyreverse test: add a class member and adapt tests
-rw-r--r--test/data/classes_No_Name.dot5
-rw-r--r--test/data/clientmodule_test.py1
-rw-r--r--test/unittest_pyreverse_diadefs.py7
3 files changed, 8 insertions, 5 deletions
diff --git a/test/data/classes_No_Name.dot b/test/data/classes_No_Name.dot
index a556732..975ecf6 100644
--- a/test/data/classes_No_Name.dot
+++ b/test/data/classes_No_Name.dot
@@ -1,11 +1,12 @@
digraph "classes_No_Name" {
charset="utf-8"
rankdir=BT
-"4" [shape="record", label="{Ancestor|attr : str\l|get_value()\lset_value()\l}"];
-"5" [shape="record", label="{Specialization|relation\l|}"];
+"4" [shape="record", label="{Ancestor|attr : str\lcls_member\l|set_value()\lget_value()\l}"];
+"5" [shape="record", label="{Specialization|relation\ltop : str\lTYPE : str\l|}"];
"8" [shape="record", label="{«interface»\nInterface|\l|get_value()\lset_value()\l}"];
"9" [shape="record", label="{DoNothing|\l|}"];
"5" -> "4" [arrowtail="none", arrowhead="empty"];
"4" -> "8" [arrowtail="node", style="dashed", arrowhead="empty"];
+"9" -> "4" [arrowhead="diamond", style="solid", arrowtail="none", fontcolor="green", label="cls_member"];
"9" -> "5" [arrowhead="diamond", style="solid", arrowtail="none", fontcolor="green", label="relation"];
}
diff --git a/test/data/clientmodule_test.py b/test/data/clientmodule_test.py
index 4efe45e..e520e88 100644
--- a/test/data/clientmodule_test.py
+++ b/test/data/clientmodule_test.py
@@ -4,6 +4,7 @@ from data.suppliermodule_test import Interface, DoNothing
class Ancestor(object):
""" Ancestor method """
__implements__ = (Interface,)
+ cls_member = DoNothing()
def __init__(self, value):
local_variable = 0
diff --git a/test/unittest_pyreverse_diadefs.py b/test/unittest_pyreverse_diadefs.py
index 19039f1..3d8f99b 100644
--- a/test/unittest_pyreverse_diadefs.py
+++ b/test/unittest_pyreverse_diadefs.py
@@ -122,9 +122,10 @@ class DefaultDiadefGeneratorTC(unittest.TestCase):
{'node': True, 'name': 'Specialization'}]
)
- _should_rels = [('association', 'DoNothing', 'Specialization'),
- ('implements', 'Ancestor', 'Interface'),
- ('specialization', 'Specialization', 'Ancestor')]
+ _should_rels = [('association', 'DoNothing', 'Ancestor'),
+ ('association', 'DoNothing', 'Specialization'),
+ ('implements', 'Ancestor', 'Interface'),
+ ('specialization', 'Specialization', 'Ancestor')]
def test_exctract_relations(self):
"""test extract_relations between classes"""
cd = DefaultDiadefGenerator(Linker(PROJECT), HANDLER).visit(PROJECT)[1]