From 030daed15f75459a4431fd6ca00b110b79ad41cf Mon Sep 17 00:00:00 2001 From: Arturo Volpe Date: Sun, 23 Apr 2023 22:38:20 -0400 Subject: [PATCH] feat: Add test to check load of yml file Signed-off-by: Arturo Volpe --- tests/test_cli.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index e22d6d5..d63b402 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -164,6 +164,23 @@ def test_spec_from_local(self): self.assertEqual(set([n.name for n in context.root.children]), set(['users', 'orgs'])) + def test_spec_from_local_yml(self): + spec_filepath = self.make_tempfile(""" + paths: + /users: + get: + description: + /orgs: + get: + description: + """) + result, context = run_and_exit(['example.com', "--spec", + spec_filepath]) + self.assertEqual(result.exit_code, 0) + self.assertEqual(context.url, 'http://example.com') + self.assertEqual(set([n.name for n in context.root.children]), + set(['users', 'orgs'])) + def test_spec_basePath(self): spec_filepath = self.make_tempfile(json.dumps({ 'basePath': '/api/v1',