with open('{}/{}.yaml'.format(QPI_PATH, name)) as conf:
qpi = yaml.safe_load(conf)
for section in qpi['sections']:
- table.add_row([section['name'], section['description'],
- section['formula']])
+ try:
+ table.add_row([section['name'], section['description'],
+ section['formula']])
+ except Exception:
+ table.add_row([section['name'], section['description'],
+ 'Not Available'])
click.echo(table)
assert 'QTIP Performance Index of compute' in result.output
-def test_show(runner):
- result = runner.invoke(cli, ['qpi', 'show', 'compute'])
+@pytest.mark.parametrize("test_input", [
+ 'storage',
+ 'compute'])
+def test_show(runner, test_input):
+ result = runner.invoke(cli, ['qpi', 'show', test_input])
assert 'QPI' in result.output
assert 'Description' in result.output
assert 'Formula' in result.output