diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-07-20 21:47:17 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2017-03-29 13:29:57 +0200 |
commit | c5529d8979672d4cf92d4ba54ce01256ca1d0842 (patch) | |
tree | 949ee5e202ac74bb2d8c0960ade8cc2396ac334c /testsuite/Testschema/test_schema.py | |
parent | 08f7ebc85d51932635d16c420e99d547d4a7eb81 (diff) | |
download | bcfg2-c5529d8979672d4cf92d4ba54ce01256ca1d0842.tar.gz bcfg2-c5529d8979672d4cf92d4ba54ce01256ca1d0842.tar.bz2 bcfg2-c5529d8979672d4cf92d4ba54ce01256ca1d0842.zip |
travis-ci: Cache common xml schema files
Diffstat (limited to 'testsuite/Testschema/test_schema.py')
-rw-r--r-- | testsuite/Testschema/test_schema.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/testsuite/Testschema/test_schema.py b/testsuite/Testschema/test_schema.py index cd9b74cdf..138468a91 100644 --- a/testsuite/Testschema/test_schema.py +++ b/testsuite/Testschema/test_schema.py @@ -34,13 +34,18 @@ NSMAP = dict(xs=XS) class TestSchemas(Bcfg2TestCase): schema_url = "http://www.w3.org/2001/XMLSchema.xsd" + catalog_file = os.path.expanduser("~/.cache/xml/catalog.xml") @skipUnless(HAS_XMLLINT, "xmllint not installed") def test_valid(self): + env = os.environ.copy() + if os.path.exists(self.catalog_file): + print('Using cached schema files.') + env["SGML_CATALOG_FILES"] = self.catalog_file schemas = [s for s in glob.glob(os.path.join(srcpath, '*.xsd'))] - xmllint = Popen(['xmllint', '--xinclude', '--noout', '--schema', - self.schema_url] + schemas, - stdout=PIPE, stderr=STDOUT) + xmllint = Popen(['xmllint', '--xinclude', '--noout', '--catalogs', + '--schema', self.schema_url] + schemas, + stdout=PIPE, stderr=STDOUT, env=env) print(xmllint.communicate()[0].decode()) self.assertEqual(xmllint.wait(), 0) |