Add a test that actually checks the vendored schema against upstream.

This commit is contained in:
Eric Snow 2018-01-11 17:29:35 +00:00
parent 1f9b0f84dd
commit 65fff09ee5
2 changed files with 19 additions and 0 deletions

View file

View file

@ -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')