[Zope3-checkins] CVS: Zope3/src/zope/schema/tests - states.py:1.1.2.2 tabcomplete.py:1.1.2.2 test_tabcomplete.py:1.1.2.2 test_vocabulary.py:1.1.2.3
Fred L. Drake, Jr.
fred@zope.com
Wed, 7 May 2003 16:50:22 -0400
Update of /cvs-repository/Zope3/src/zope/schema/tests
In directory cvs.zope.org:/tmp/cvs-serv15457/tests
Modified Files:
Tag: schema-vocabulary-branch
states.py tabcomplete.py test_tabcomplete.py
test_vocabulary.py
Log Message:
Move the vocabulary interfaces to the zope.schema.interfaces module.
=== Zope3/src/zope/schema/tests/states.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/states.py:1.1.2.1 Fri May 2 10:11:16 2003
+++ Zope3/src/zope/schema/tests/states.py Wed May 7 16:50:21 2003
@@ -14,6 +14,7 @@
"""Sample vocabulary supporting state abbreviations."""
+from zope.schema import interfaces
from zope.schema import vocabulary
@@ -84,7 +85,7 @@
class State:
__slots__ = 'value', 'title'
- __implements__ = vocabulary.ITerm
+ __implements__ = interfaces.ITerm
def __init__(self, value, title):
self.value = value
@@ -94,7 +95,7 @@
_states[v] = State(v, p)
-class IStateVocabulary(vocabulary.IVocabulary):
+class IStateVocabulary(interfaces.IVocabulary):
"""Vocabularies that support the states database conform to this."""
=== Zope3/src/zope/schema/tests/tabcomplete.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/tabcomplete.py:1.1.2.1 Fri May 2 10:11:16 2003
+++ Zope3/src/zope/schema/tests/tabcomplete.py Wed May 7 16:50:21 2003
@@ -15,7 +15,7 @@
"""Example vocabulary for tab completion."""
-from zope.schema.vocabulary import ITerm, ISubsetVocabulary, IVocabulary
+from zope.schema.interfaces import ITerm, ISubsetVocabulary, IVocabulary
class Term:
=== Zope3/src/zope/schema/tests/test_tabcomplete.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/schema/tests/test_tabcomplete.py:1.1.2.1 Fri May 2 10:11:16 2003
+++ Zope3/src/zope/schema/tests/test_tabcomplete.py Wed May 7 16:50:21 2003
@@ -17,6 +17,7 @@
import unittest
from zope.schema import vocabulary
+from zope.schema.interfaces import ITerm
from zope.schema.tests import tabcomplete
@@ -40,7 +41,7 @@
def test_getTerm(self):
term = self.vocab.getTerm("abc")
- self.assert_(vocabulary.ITerm.isImplementedBy(term))
+ self.assert_(ITerm.isImplementedBy(term))
self.assertEqual(term.value, "abc")
=== Zope3/src/zope/schema/tests/test_vocabulary.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/schema/tests/test_vocabulary.py:1.1.2.2 Fri May 2 11:32:19 2003
+++ Zope3/src/zope/schema/tests/test_vocabulary.py Wed May 7 16:50:21 2003
@@ -17,7 +17,7 @@
import sys
import unittest
-from zope.schema.interfaces import ValidationError
+from zope.schema import interfaces
from zope.schema import vocabulary
@@ -50,7 +50,7 @@
def test_getVocabularyRegistry(self):
r = vocabulary.getVocabularyRegistry()
- self.assert_(vocabulary.IVocabularyRegistry.isImplementedBy(r))
+ self.assert_(interfaces.IVocabularyRegistry.isImplementedBy(r))
# XXX still need to test the default implementation
@@ -58,7 +58,7 @@
pass
class SampleVocabulary:
- __implements__ = vocabulary.IVocabulary
+ __implements__ = interfaces.IVocabulary
def __contains__(self, value):
return 0 <= value < 10
@@ -88,7 +88,7 @@
self.assert_(bound.vocabularyName is None)
bound.default = okval
self.assertEqual(bound.default, okval)
- self.assertRaises(ValidationError,
+ self.assertRaises(interfaces.ValidationError,
setattr, bound, "default", badval)
def test_preconstructed_vocabulary(self):
@@ -108,7 +108,7 @@
self.assert_(isinstance(bound.vocabulary, SampleVocabulary))
bound.default = okval
self.assertEqual(bound.default, okval)
- self.assertRaises(ValidationError,
+ self.assertRaises(interfaces.ValidationError,
setattr, bound, "default", badval)
def test_constructed_vocabulary(self):