Exemple #1
0
 def test_simple_import_with_cache(self):
     loader = ZConfig.loader.SchemaLoader()
     url1 = ZConfig.url.urljoin(CONFIG_BASE, "library.xml")
     schema1 = loader.loadURL(url1)
     sio = StringIO("<schema>"
                    "  <import src='library.xml'/>"
                    "  <section type='type-a' name='section'/>"
                    "</schema>")
     url2 = ZConfig.url.urljoin(CONFIG_BASE, "stringio")
     schema2 = loader.loadFile(sio, url2)
     self.assertTrue(schema1.gettype("type-a") is schema2.gettype("type-a"))
Exemple #2
0
 def test_simple_import_with_cache(self):
     loader = ZConfig.loader.SchemaLoader()
     url1 = ZConfig.url.urljoin(CONFIG_BASE, "library.xml")
     schema1 = loader.loadURL(url1)
     sio = StringIO("<schema>"
                    "  <import src='library.xml'/>"
                    "  <section type='type-a' name='section'/>"
                    "</schema>")
     url2 = ZConfig.url.urljoin(CONFIG_BASE, "stringio")
     schema2 = loader.loadFile(sio, url2)
     self.assertTrue(schema1.gettype("type-a") is schema2.gettype("type-a"))
Exemple #3
0
 def test_schema_caching(self):
     loader = ZConfig.loader.SchemaLoader()
     url = ZConfig.url.urljoin(CONFIG_BASE, "simple.xml")
     schema1 = loader.loadURL(url)
     schema2 = loader.loadURL(url)
     self.assertIs(schema1, schema2)
Exemple #4
0
 def test_schema_caching(self):
     loader = ZConfig.loader.SchemaLoader()
     url = ZConfig.url.urljoin(CONFIG_BASE, "simple.xml")
     schema1 = loader.loadURL(url)
     schema2 = loader.loadURL(url)
     self.assertTrue(schema1 is schema2)