Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main_tool.py #843

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tests/cli/main_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,19 @@ def testRecipeSetupArgs(self):
runtime_name = module.get('runtime_name', module['name'])
if runtime_name in self.tool.state._module_pool:
setup_func = self.tool.state._module_pool[runtime_name].SetUp
expected_args = set(inspect.getfullargspec(setup_func).args)
expected_args.remove('self')
signature = inspect.signature(setup_func)
expected_positional_args = {
param.name
for param in signature.parameters.values()
if param.kind == param.POSITIONAL_ONLY
}
provided_args = set(module['args'])

self.assertEqual(
expected_args,
provided_args,
f'Error in {recipe.name}:{runtime_name}')
self.assertTrue(
# Provided args include all positional args
expected_positional_args.issubset(provided_args),
f'Error in {recipe.name}:{runtime_name}',
)

def testRecipeValidators(self):
"""Tests that recipes do not specify invalid validators."""
Expand Down
Loading