Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ac7aeb96
Commit
ac7aeb96
authored
Jul 30, 2003
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backported bugfix for tagged values from Zope3.
parent
2de1623f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
lib/python/Interface/_Element.py
lib/python/Interface/_Element.py
+2
-3
lib/python/Interface/tests/testElement.py
lib/python/Interface/tests/testElement.py
+43
-0
No files found.
lib/python/Interface/_Element.py
View file @
ac7aeb96
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
"""
"""
Revision information:
Revision information:
$Id: _Element.py,v 1.
4 2003/07/25 13:48:34 anthony
Exp $
$Id: _Element.py,v 1.
5 2003/07/30 22:09:23 philikon
Exp $
"""
"""
from
_object
import
object
from
_object
import
object
...
@@ -26,8 +26,6 @@ class Element(object):
...
@@ -26,8 +26,6 @@ class Element(object):
#
#
#__implements__ = IElement
#__implements__ = IElement
__tagged_values
=
{}
def
__init__
(
self
,
__name__
=
None
,
__doc__
=
''
):
def
__init__
(
self
,
__name__
=
None
,
__doc__
=
''
):
"""Create an 'attribute' description
"""Create an 'attribute' description
"""
"""
...
@@ -37,6 +35,7 @@ class Element(object):
...
@@ -37,6 +35,7 @@ class Element(object):
self
.
__name__
=
__name__
self
.
__name__
=
__name__
self
.
__doc__
=
__doc__
self
.
__doc__
=
__doc__
self
.
__tagged_values
=
{}
def
getName
(
self
):
def
getName
(
self
):
""" Returns the name of the object. """
""" Returns the name of the object. """
...
...
lib/python/Interface/tests/testElement.py
0 → 100644
View file @
ac7aeb96
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import
unittest
from
Interface._Element
import
Element
class
ElementTests
(
unittest
.
TestCase
):
def
test_taggedValues
(
self
):
"""Test that we can update tagged values of more than one element
"""
e1
=
Element
(
"foo"
)
e2
=
Element
(
"bar"
)
e1
.
setTaggedValue
(
"x"
,
1
)
e2
.
setTaggedValue
(
"x"
,
2
)
self
.
assertEqual
(
e1
.
getTaggedValue
(
"x"
),
1
)
self
.
assertEqual
(
e2
.
getTaggedValue
(
"x"
),
2
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
ElementTests
))
return
suite
def
test_suite
():
return
unittest
.
makeSuite
(
ElementTests
)
def
main
():
unittest
.
TextTestRunner
().
run
(
test_suite
())
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment