Skip to content

Commit

Permalink
feat: Add test to check load of yml file
Browse files Browse the repository at this point in the history
Signed-off-by: Arturo Volpe <[email protected]>
  • Loading branch information
aVolpe committed Apr 24, 2023
1 parent 8e873b8 commit 030daed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 030daed

Please sign in to comment.