summaryrefslogtreecommitdiffstats
path: root/testsuite/Testschema/test_schema.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2017-08-18 15:01:32 -0500
committerSol Jerome <sol.jerome@gmail.com>2017-08-18 15:01:32 -0500
commite193079d1779e4d66d80882e6f1c3ff9ba05619b (patch)
treeb47f262f3b7d57a1ddeefd0f2aeba3bb35539d18 /testsuite/Testschema/test_schema.py
parentcd0f5f5f62376f7dc64e5c5c7d59a7c6bfcb918f (diff)
parent0fdabbcb4668d5f70f76c08a6e3216c5542e7457 (diff)
downloadbcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.tar.gz
bcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.tar.bz2
bcfg2-e193079d1779e4d66d80882e6f1c3ff9ba05619b.zip
Merge branch 'feature/travis-container' of https://github.com/AlexanderS/bcfg2
Diffstat (limited to 'testsuite/Testschema/test_schema.py')
-rw-r--r--testsuite/Testschema/test_schema.py11
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)