[Zope3-checkins] CVS: Zope3/src/zope/schema/tests - test_states.py:1.4

Fred L. Drake, Jr. fred@zope.com
Tue, 15 Jul 2003 12:55:30 -0400


Update of /cvs-repository/Zope3/src/zope/schema/tests
In directory cvs.zope.org:/tmp/cvs-serv20165

Modified Files:
	test_states.py 
Log Message:
- removed unused class
- added tests that StateVocabulary conforms to IVocabulary


=== Zope3/src/zope/schema/tests/test_states.py 1.3 => 1.4 ===
--- Zope3/src/zope/schema/tests/test_states.py:1.3	Wed Jun  4 05:09:46 2003
+++ Zope3/src/zope/schema/tests/test_states.py	Tue Jul 15 12:55:25 2003
@@ -17,8 +17,10 @@
 import unittest
 
 from zope.interface import Interface, implements
+from zope.interface.verify import verifyObject
 
 from zope.schema import vocabulary
+from zope.schema.interfaces import IVocabulary
 from zope.schema.tests import states
 
 
@@ -46,12 +48,6 @@
         vocabulary="states",
         )
 
-class BirthInfo:
-    implements(IBirthInfo)
-
-    def __init__(self):
-        self.state = state
-
 
 class StateSelectionTest(unittest.TestCase):
     def setUp(self):
@@ -65,10 +61,12 @@
     def test_default_presentation(self):
         field = IBirthInfo.getDescriptionFor("state1")
         bound = field.bind(object())
+        self.assert_(verifyObject(IVocabulary, bound.vocabulary))
         self.assertEqual(bound.vocabulary.getTerm("VA").title, "Virginia")
 
     def test_contains(self):
         vocab = states.StateVocabulary()
+        self.assert_(verifyObject(IVocabulary, vocab))
         count = 0
         L = list(vocab)
         for term in L:
@@ -86,6 +84,7 @@
         field = IBirthInfo.getDescriptionFor("state3")
         bound = field.bind(None)
         self.assert_(bound.vocabularyName is None)
+        self.assert_(verifyObject(IVocabulary, bound.vocabulary))
         self.assert_("AL" in bound.vocabulary)