From 65fff09ee56abbb2bfc3db912725b951073765f2 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Thu, 11 Jan 2018 17:29:35 +0000 Subject: [PATCH] Add a test that actually checks the vendored schema against upstream. --- tests/system_tests/__init__.py | 0 tests/system_tests/test_schema.py | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/system_tests/__init__.py create mode 100644 tests/system_tests/test_schema.py diff --git a/tests/system_tests/__init__.py b/tests/system_tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/system_tests/test_schema.py b/tests/system_tests/test_schema.py new file mode 100644 index 00000000..f020e86e --- /dev/null +++ b/tests/system_tests/test_schema.py @@ -0,0 +1,19 @@ +import contextlib +import io +import unittest + +from debugger_protocol.schema.__main__ import handle_check + + +class VendoredSchemaTests(unittest.TestCase): + + def test_matches_upstream(self): + stdout = io.StringIO() + with contextlib.redirect_stdout(stdout): + with contextlib.redirect_stderr(stdout): + try: + handle_check() + except Exception as exc: + self.fail(str(exc)) + result = stdout.getvalue().strip().splitlines()[-1] + self.assertEqual(result, 'schema file okay')