[test] update cubicweb/test/unittest_schema.py (to follow yams#.....)
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Thu, 26 May 2011 14:38:49 +0200
changeset 7469 f8c983afbf8e
parent 7466 395c966a1cb3
child 7470 c3fc72ee720a
[test] update cubicweb/test/unittest_schema.py (to follow yams#.....)
test/unittest_schema.py
--- a/test/unittest_schema.py	Tue Jun 07 10:03:31 2011 +0200
+++ b/test/unittest_schema.py	Thu May 26 14:38:49 2011 +0200
@@ -29,7 +29,7 @@
 from yams import BadSchemaDefinition
 from yams.constraints import SizeConstraint, StaticVocabularyConstraint
 from yams.buildobjs import RelationDefinition, EntityType, RelationType
-from yams.reader import PyFileReader
+from yams.reader import fill_schema
 
 from cubicweb.schema import (
     CubicWebSchema, CubicWebEntitySchema, CubicWebSchemaLoader,
@@ -270,12 +270,12 @@
         self.loader.defined = {}
         self.loader.loaded_files = []
         self.loader.post_build_callbacks = []
-        self.loader._pyreader = PyFileReader(self.loader)
 
     def _test(self, schemafile, msg):
         self.loader.handle_file(join(DATADIR, schemafile))
+        sch = self.loader.schemacls('toto')
         with self.assertRaises(BadSchemaDefinition) as cm:
-            self.loader._build_schema('toto', False)
+            fill_schema(sch, self.loader.defined, False)
         self.assertEqual(str(cm.exception), msg)
 
     def test_lowered_etype(self):