test_element.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. ##############################################################################
  2. #
  3. # Copyright (c) 2003 Zope Foundation and Contributors.
  4. # All Rights Reserved.
  5. #
  6. # This software is subject to the provisions of the Zope Public License,
  7. # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
  8. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
  9. # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  10. # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
  11. # FOR A PARTICULAR PURPOSE.
  12. #
  13. ##############################################################################
  14. """Test Element meta-class.
  15. """
  16. import unittest
  17. from zope.interface.interface import Element
  18. class TestElement(unittest.TestCase):
  19. def test_taggedValues(self):
  20. """Test that we can update tagged values of more than one element
  21. """
  22. e1 = Element("foo")
  23. e2 = Element("bar")
  24. e1.setTaggedValue("x", 1)
  25. e2.setTaggedValue("x", 2)
  26. self.assertEqual(e1.getTaggedValue("x"), 1)
  27. self.assertEqual(e2.getTaggedValue("x"), 2)