def test_cli(self):
"""Test out the tune finder."""
path = make_fixture_path('basic')
@cli.cli.command()
@click.pass_obj
def clitest(obj): # pylint: disable=unused-variable
"""Command to test base context."""
self.assertEqual(obj['path'], path)
self.assertTrue('hi' in obj['tune'].dancers)
result = self.runner.invoke(cli.cli, ['--path', path, 'clitest'])
self.assertEqual(0, result.exit_code)
result = self.runner.invoke(
cli.cli,
['--path', make_fixture_path('nodancers', None), 'clitest']
)
self.assertEqual(1, result.exit_code)
self.assertIn(
'Unable to find Lambada class declaration',
result.output
)
评论列表
文章目录