diff --git a/opnsense_cli/click_addons/command_autoloader.py b/opnsense_cli/click_addons/command_autoloader.py index b3f0821..4483a0f 100644 --- a/opnsense_cli/click_addons/command_autoloader.py +++ b/opnsense_cli/click_addons/command_autoloader.py @@ -31,7 +31,7 @@ def autoload(self, module_name=None, ignore_dirs=None): :return: click.core.Group """ if ignore_dirs is None: - ignore_dirs = ['__pycache__', 'tests', 'services'] + ignore_dirs = ["__pycache__", "tests", "services"] spec = importlib.util.find_spec(module_name) path = spec.submodule_search_locations[0] diff --git a/opnsense_cli/code_generators/base.py b/opnsense_cli/code_generators/base.py index fccb342..4686ca4 100644 --- a/opnsense_cli/code_generators/base.py +++ b/opnsense_cli/code_generators/base.py @@ -25,5 +25,3 @@ def get_code(self): @abstractmethod def _get_template_vars(self): """ " This method should be implemented.""" - - diff --git a/opnsense_cli/code_generators/opn_cli/base.py b/opnsense_cli/code_generators/opn_cli/base.py index accd661..843c73f 100644 --- a/opnsense_cli/code_generators/opn_cli/base.py +++ b/opnsense_cli/code_generators/opn_cli/base.py @@ -7,15 +7,15 @@ class CommandCodeGenerator(CodeGenerator): def __init__( - self, - tag_content: Tag, - template_engine: TemplateEngine, - option_factory: ObjectTypeFromDataFactory, - template, - group, - command, - model_xml_tag, - module_type, + self, + tag_content: Tag, + template_engine: TemplateEngine, + option_factory: ObjectTypeFromDataFactory, + template, + group, + command, + model_xml_tag, + module_type, ): self._tag_content: Tag = tag_content self._template_engine = template_engine @@ -25,4 +25,3 @@ def __init__( self._click_option_factory = option_factory self._model_xml_tag = model_xml_tag self._module_type = module_type - diff --git a/opnsense_cli/code_generators/opn_cli/factories.py b/opnsense_cli/code_generators/opn_cli/factories.py index 09528cf..d460e96 100644 --- a/opnsense_cli/code_generators/opn_cli/factories.py +++ b/opnsense_cli/code_generators/opn_cli/factories.py @@ -1,9 +1,13 @@ from bs4.element import Tag from opnsense_cli.code_generators.opn_cli.factory_types import ClickOptionCodeFragment from opnsense_cli.factories import ObjectTypeFromDataFactory, FactoryException -from opnsense_cli.code_generators.opn_cli.factory_types import ClickBoolean, ClickText, ClickInteger, ClickChoice, \ - ClickTextLinkedItem - +from opnsense_cli.code_generators.opn_cli.factory_types import ( + ClickBoolean, + ClickText, + ClickInteger, + ClickChoice, + ClickTextLinkedItem, +) class ClickOptionCodeTypeFactory(ObjectTypeFromDataFactory): diff --git a/opnsense_cli/code_generators/opn_cli/unit_test/codegenerator.py b/opnsense_cli/code_generators/opn_cli/unit_test/codegenerator.py index 84774cc..3c18c1b 100644 --- a/opnsense_cli/code_generators/opn_cli/unit_test/codegenerator.py +++ b/opnsense_cli/code_generators/opn_cli/unit_test/codegenerator.py @@ -3,7 +3,6 @@ class ClickCommandTestCodeGenerator(CommandCodeGenerator): - def _get_template_vars(self): return CommandTestTemplateVars( click_command=self._click_command, diff --git a/opnsense_cli/code_generators/puppet_code/acceptance_test/codegenerator.py b/opnsense_cli/code_generators/puppet_code/acceptance_test/codegenerator.py index 309d737..4dfbec4 100644 --- a/opnsense_cli/code_generators/puppet_code/acceptance_test/codegenerator.py +++ b/opnsense_cli/code_generators/puppet_code/acceptance_test/codegenerator.py @@ -21,7 +21,6 @@ def __init__( self._template = template self._update_command_params = update_command_params - def _get_template_vars(self): return PuppetAcceptanceTestTemplateVars( click_command=self._click_command, diff --git a/opnsense_cli/code_generators/puppet_code/base.py b/opnsense_cli/code_generators/puppet_code/base.py index 95997d5..cebd855 100644 --- a/opnsense_cli/code_generators/puppet_code/base.py +++ b/opnsense_cli/code_generators/puppet_code/base.py @@ -2,14 +2,15 @@ from opnsense_cli.code_generators.puppet_code.factories import PuppetCodeFragmentFactory from typing import List + class PuppetCodeGenerator(CodeGenerator): def __init__( - self, - create_command_params, - type_factory: PuppetCodeFragmentFactory, - find_uuid_by_column, - click_group, - click_command, + self, + create_command_params, + type_factory: PuppetCodeFragmentFactory, + find_uuid_by_column, + click_group, + click_command, ): self._create_command_params = create_command_params self._type_factory = type_factory @@ -52,5 +53,3 @@ def _get_all_columns(self): continue columns.append(param_line["name"]) return columns - - diff --git a/opnsense_cli/code_generators/puppet_code/factories.py b/opnsense_cli/code_generators/puppet_code/factories.py index ce41ac5..0ea6e99 100644 --- a/opnsense_cli/code_generators/puppet_code/factories.py +++ b/opnsense_cli/code_generators/puppet_code/factories.py @@ -1,6 +1,13 @@ from opnsense_cli.factories import ObjectTypeFromDataFactory, FactoryException -from opnsense_cli.code_generators.puppet_code.factory_types import PuppetCodeFragment, PuppetBoolean, PuppetChoice, \ - PuppetChoiceMultiple, PuppetCsv, PuppetInteger, PuppetString +from opnsense_cli.code_generators.puppet_code.factory_types import ( + PuppetCodeFragment, + PuppetBoolean, + PuppetChoice, + PuppetChoiceMultiple, + PuppetCsv, + PuppetInteger, + PuppetString, +) class PuppetCodeFragmentFactory(ObjectTypeFromDataFactory): diff --git a/opnsense_cli/code_generators/puppet_code/factory_types.py b/opnsense_cli/code_generators/puppet_code/factory_types.py index 9737f1b..95137b1 100644 --- a/opnsense_cli/code_generators/puppet_code/factory_types.py +++ b/opnsense_cli/code_generators/puppet_code/factory_types.py @@ -142,6 +142,7 @@ class PuppetBoolean(PuppetCodeFragment): expect(r.stdout).to match %r{${name}: '0'} """ + class PuppetChoice(PuppetCodeFragment): TEMPLATE_PROVIDER_translate_json_object_to_puppet_resource = """ ${name}: json_object['${name}'], @@ -189,6 +190,7 @@ class PuppetChoice(PuppetCodeFragment): expect(r.stdout).to match %r{${name}: 'TODO'} """ + class PuppetChoiceMultiple(PuppetCodeFragment): TEMPLATE_PROVIDER_translate_json_object_to_puppet_resource = """ ${name}: array_from_value(json_object['${name}']), @@ -240,6 +242,7 @@ class PuppetChoiceMultiple(PuppetCodeFragment): expect(r.stdout).to match %r{${name}: 'TODO'} """ + class PuppetCsv(PuppetCodeFragment): TEMPLATE_PROVIDER_translate_json_object_to_puppet_resource = """ ${name}: array_from_value(json_object['${name}']), @@ -288,6 +291,7 @@ class PuppetCsv(PuppetCodeFragment): expect(r.stdout).to match %r{${name}: '\\[\\]'} """ + class PuppetInteger(PuppetCodeFragment): TEMPLATE_PROVIDER_translate_json_object_to_puppet_resource = """ ${name}: json_object['${name}'], @@ -343,6 +347,7 @@ class PuppetInteger(PuppetCodeFragment): expect(r.stdout).to match %r{${name}: 'TODO'} """ + class PuppetString(PuppetCodeFragment): TEMPLATE_PROVIDER_translate_json_object_to_puppet_resource = """ ${name}: json_object['${name}'], @@ -415,5 +420,3 @@ class PuppetString(PuppetCodeFragment): TEMPLATE_ACCEPTANCE_TEST_match_item_namevar = """ expect(r.stdout).to match %r{${name}: acceptance test item} """ - - diff --git a/opnsense_cli/code_generators/puppet_code/provider_unit_test/codegenerator.py b/opnsense_cli/code_generators/puppet_code/provider_unit_test/codegenerator.py index 9720b4c..fb84330 100644 --- a/opnsense_cli/code_generators/puppet_code/provider_unit_test/codegenerator.py +++ b/opnsense_cli/code_generators/puppet_code/provider_unit_test/codegenerator.py @@ -21,7 +21,6 @@ def __init__( self._template = template self._update_command_params = update_command_params - def _get_template_vars(self): return PuppetProviderUnitTestTemplateVars( click_command=self._click_command, diff --git a/opnsense_cli/code_generators/puppet_code/type/codegenerator.py b/opnsense_cli/code_generators/puppet_code/type/codegenerator.py index 12a6e8d..9d66d8d 100644 --- a/opnsense_cli/code_generators/puppet_code/type/codegenerator.py +++ b/opnsense_cli/code_generators/puppet_code/type/codegenerator.py @@ -21,7 +21,6 @@ def __init__( self._template = template self._update_command_params = update_command_params - def _get_template_vars(self): return PuppetTypeTemplateVars( click_command=self._click_command, diff --git a/opnsense_cli/code_generators/puppet_code/type_unit_test/codegenerator.py b/opnsense_cli/code_generators/puppet_code/type_unit_test/codegenerator.py index 875680d..97a613a 100644 --- a/opnsense_cli/code_generators/puppet_code/type_unit_test/codegenerator.py +++ b/opnsense_cli/code_generators/puppet_code/type_unit_test/codegenerator.py @@ -21,7 +21,6 @@ def __init__( self._template = template self._update_command_params = update_command_params - def _get_template_vars(self): return PuppetTypeUnitTestTemplateVars( click_command=self._click_command, diff --git a/opnsense_cli/commands/core/configbackup/tests/test_configbackup.py b/opnsense_cli/commands/core/configbackup/tests/test_configbackup.py index 8177d14..c5a6d8f 100644 --- a/opnsense_cli/commands/core/configbackup/tests/test_configbackup.py +++ b/opnsense_cli/commands/core/configbackup/tests/test_configbackup.py @@ -7,7 +7,9 @@ class TestApibackupCommands(CommandTestCase): def setUp(self): self._setup_fakefs() - self._api_data_fixtures_download = self._read_fixture_file("fixtures/config.xml.sample", base_dir=os.path.dirname(__file__)) + self._api_data_fixtures_download = self._read_fixture_file( + "fixtures/config.xml.sample", base_dir=os.path.dirname(__file__) + ) self._api_client_args_fixtures = ["api_key", "api_secret", "https://127.0.0.1/api", True, "~/.opn-cli/ca.pem", 60] @patch("opnsense_cli.commands.core.configbackup.backup.ApiClient.execute") diff --git a/opnsense_cli/commands/core/firewall/alias.py b/opnsense_cli/commands/core/firewall/alias.py index f019dda..9f92863 100644 --- a/opnsense_cli/commands/core/firewall/alias.py +++ b/opnsense_cli/commands/core/firewall/alias.py @@ -1,6 +1,11 @@ import click from opnsense_cli.formatters.cli_output.cli_output_formatter import CliOutputFormatter -from opnsense_cli.click_addons.callbacks import formatter_from_formatter_name, bool_as_string, comma_to_newline, available_formats +from opnsense_cli.click_addons.callbacks import ( + formatter_from_formatter_name, + bool_as_string, + comma_to_newline, + available_formats, +) from opnsense_cli.commands.core.firewall import firewall from opnsense_cli.api.client import ApiClient from opnsense_cli.api.plugin.firewall import FirewallAlias, FirewallAliasUtil diff --git a/opnsense_cli/commands/core/unbound/tests/test_unbound_alias.py b/opnsense_cli/commands/core/unbound/tests/test_unbound_alias.py index 8979594..eee8620 100644 --- a/opnsense_cli/commands/core/unbound/tests/test_unbound_alias.py +++ b/opnsense_cli/commands/core/unbound/tests/test_unbound_alias.py @@ -18,7 +18,9 @@ def setUp(self): self._api_data_fixtures_delete_NOT_FOUND = {"result": "not found"} self._api_data_fixtures_delete_OK = {"result": "deleted"} self._api_data_fixtures_list_EMPTY = {"unbound": {"aliases": {"alias": []}}} - self._api_data_fixtures_list = self._api_data_fixtures_list = self._read_json_fixture("fixtures/model_data.json", base_dir=os.path.dirname(__file__)) + self._api_data_fixtures_list = self._api_data_fixtures_list = self._read_json_fixture( + "fixtures/model_data.json", base_dir=os.path.dirname(__file__) + ) self._api_client_args_fixtures = ["api_key", "api_secret", "https://127.0.0.1/api", True, "~/.opn-cli/ca.pem", 60] @patch("opnsense_cli.commands.core.unbound.alias.ApiClient.execute") diff --git a/opnsense_cli/commands/new/command.py b/opnsense_cli/commands/new/command.py index 31f57cd..5286114 100755 --- a/opnsense_cli/commands/new/command.py +++ b/opnsense_cli/commands/new/command.py @@ -32,7 +32,11 @@ def command(**kwargs): required=True, ) @click.option( - "--tag", "-t", help="The xml tag from the core_model.xml e.g. dnsbl for unbound dnsbl command", show_default=True, required=True + "--tag", + "-t", + help="The xml tag from the core_model.xml e.g. dnsbl for unbound dnsbl command", + show_default=True, + required=True, ) @click.option( "--form-url", @@ -246,7 +250,7 @@ def write_command_service(type, model_tag: Tag, template_engine, option_factory, kwargs["tag"], type, ) - output_path = f"{kwargs['command_output_dir']}/{kwargs['click_group']}/services/{kwargs['click_group']}_{kwargs['opn_cli']}_service.py" + output_path = f"{kwargs['command_output_dir']}/{kwargs['click_group']}/services/{kwargs['click_group']}_{kwargs['opn_cli']}_service.py" # noqa: E501 click.echo(command_service_generator.write_code(output_path)) @@ -263,7 +267,9 @@ def write_command_test(type, model_tag: Tag, template_engine, option_factory, ** type, ) - output_path = f"{kwargs['command_output_dir']}/{kwargs['click_group']}/tests/test_{kwargs['click_group']}_{kwargs['opn_cli']}.py" + output_path = ( + f"{kwargs['command_output_dir']}/{kwargs['click_group']}/tests/test_{kwargs['click_group']}_{kwargs['opn_cli']}.py" + ) click.echo(command_test_generator.write_code(output_path)) diff --git a/opnsense_cli/commands/new/puppet.py b/opnsense_cli/commands/new/puppet.py index e9b0995..96664e5 100755 --- a/opnsense_cli/commands/new/puppet.py +++ b/opnsense_cli/commands/new/puppet.py @@ -124,7 +124,7 @@ def write_puppet_provider(ctx, template_engine, code_factory, create_command_par update_command_params, ) - output_path = f"{kwargs['puppet_output_dir']}/provider/opnsense_{kwargs['click_group']}_{kwargs['click_command']}/opnsense_{kwargs['click_group']}_{kwargs['click_command']}.rb" + output_path = f"{kwargs['puppet_output_dir']}/provider/opnsense_{kwargs['click_group']}_{kwargs['click_command']}/opnsense_{kwargs['click_group']}_{kwargs['click_command']}.rb" # noqa: E501 click.echo(code_generator.write_code(output_path)) @@ -158,7 +158,7 @@ def write_puppet_type_unit_test(ctx, template_engine, code_factory, create_comma update_command_params, ) - output_path = f"{kwargs['puppet_output_dir']}/spec/unit/puppet/type/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" + output_path = f"{kwargs['puppet_output_dir']}/spec/unit/puppet/type/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" # noqa: E501 click.echo(code_generator.write_code(output_path)) @@ -177,7 +177,7 @@ def write_puppet_provider_unit_test( update_command_params, ) - output_path = f"{kwargs['puppet_output_dir']}/spec/unit/puppet/provider/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" + output_path = f"{kwargs['puppet_output_dir']}/spec/unit/puppet/provider/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" # noqa: E501 click.echo(code_generator.write_code(output_path)) @@ -194,7 +194,7 @@ def write_puppet_acceptance_test(ctx, template_engine, code_factory, create_comm update_command_params, ) - output_path = f"{kwargs['puppet_output_dir']}/spec/acceptance/types/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" + output_path = f"{kwargs['puppet_output_dir']}/spec/acceptance/types/opnsense_{kwargs['click_group']}_{kwargs['click_command']}_spec.rb" # noqa: E501 click.echo(code_generator.write_code(output_path)) diff --git a/opnsense_cli/commands/new/tests/test_new_api.py b/opnsense_cli/commands/new/tests/test_new_api.py index 2d545b9..1c3fc56 100644 --- a/opnsense_cli/commands/new/tests/test_new_api.py +++ b/opnsense_cli/commands/new/tests/test_new_api.py @@ -12,8 +12,12 @@ def setUp(self): self._core_html_fixture = self._read_fixture_file("fixtures/api/core.html", base_dir=os.path.dirname(__file__)) self._plugin_html_fixture = self._read_fixture_file("fixtures/api/plugin.html", base_dir=os.path.dirname(__file__)) - self._list_core_html_fixture = self._read_fixture_file("fixtures/api/core_list.html", base_dir=os.path.dirname(__file__)) - self._list_plugin_html_fixture = self._read_fixture_file("fixtures/api/plugin_list.html", base_dir=os.path.dirname(__file__)) + self._list_core_html_fixture = self._read_fixture_file( + "fixtures/api/core_list.html", base_dir=os.path.dirname(__file__) + ) + self._list_plugin_html_fixture = self._read_fixture_file( + "fixtures/api/plugin_list.html", base_dir=os.path.dirname(__file__) + ) self._mock_html_core_resp = self._mock_response(content=self._core_html_fixture) self._mock_html_plugin_resp = self._mock_response(content=self._plugin_html_fixture) diff --git a/opnsense_cli/commands/new/tests/test_new_command.py b/opnsense_cli/commands/new/tests/test_new_command.py index 0f62576..c8a03c1 100644 --- a/opnsense_cli/commands/new/tests/test_new_command.py +++ b/opnsense_cli/commands/new/tests/test_new_command.py @@ -10,10 +10,16 @@ class TestNewCommandCommands(CommandTestCase): def setUp(self): self._setup_fakefs() - self._core_model_fixture = self._read_fixture_file("fixtures/opn_cli/core_model.xml", base_dir=os.path.dirname(__file__)) + self._core_model_fixture = self._read_fixture_file( + "fixtures/opn_cli/core_model.xml", base_dir=os.path.dirname(__file__) + ) self._core_form_fixture = self._read_fixture_file("fixtures/opn_cli/core_form.xml", base_dir=os.path.dirname(__file__)) - self._plugin_model_fixture = self._read_fixture_file("fixtures/opn_cli/plugin_model.xml", base_dir=os.path.dirname(__file__)) - self._plugin_form_fixture = self._read_fixture_file("fixtures/opn_cli/plugin_form.xml", base_dir=os.path.dirname(__file__)) + self._plugin_model_fixture = self._read_fixture_file( + "fixtures/opn_cli/plugin_model.xml", base_dir=os.path.dirname(__file__) + ) + self._plugin_form_fixture = self._read_fixture_file( + "fixtures/opn_cli/plugin_form.xml", base_dir=os.path.dirname(__file__) + ) self._mock_model_core_resp = self._mock_response(content=self._core_model_fixture) self._mock_form_core_resp = self._mock_response(content=self._core_form_fixture) @@ -27,7 +33,9 @@ def setUp(self): self._output_dir = self._get_output_path() self._generated_plugin_command_path = f"{self._output_dir}/commands/plugin/haproxy/frontend.py" - self._generated_plugin_service_path = f"{self._output_dir}/commands/plugin/haproxy/services/haproxy_frontend_service.py" + self._generated_plugin_service_path = ( + f"{self._output_dir}/commands/plugin/haproxy/services/haproxy_frontend_service.py" + ) self._generated_plugin_test_path = f"{self._output_dir}/commands/plugin/haproxy/tests/test_haproxy_frontend.py" self._generated_core_command_path = f"{self._output_dir}/commands/core/firewall/category.py" diff --git a/opnsense_cli/commands/plugin/apibackup/tests/test_apibackup.py b/opnsense_cli/commands/plugin/apibackup/tests/test_apibackup.py index ad660d0..0e7ef0f 100644 --- a/opnsense_cli/commands/plugin/apibackup/tests/test_apibackup.py +++ b/opnsense_cli/commands/plugin/apibackup/tests/test_apibackup.py @@ -4,11 +4,11 @@ import base64 import os + class TestApibackupCommands(CommandTestCase): def setUp(self): self._setup_fakefs() - self._config_xml = self._read_fixture_file("fixtures/config.xml.sample", base_dir=os.path.dirname(__file__)) self._api_data_fixtures_download = { "status": "success", diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_acl.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_acl.py index c6f11ea..aee0110 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_acl.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_acl.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyAclCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_action.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_action.py index 0421963..415a556 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_action.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_action.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyActionCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_backend.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_backend.py index f874cd8..f4e4e87 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_backend.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_backend.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyBackendCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_cpu.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_cpu.py index 1395017..5997a50 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_cpu.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_cpu.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyCpuCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_errorfile.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_errorfile.py index b7e7228..ebd4be2 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_errorfile.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_errorfile.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyErrorfileCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_frontend.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_frontend.py index 54b121c..42b4a72 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_frontend.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_frontend.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyFrontendCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_group.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_group.py index 4a5479b..2ed2d38 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_group.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_group.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyGroupCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_healthcheck.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_healthcheck.py index e17145a..9f7b222 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_healthcheck.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_healthcheck.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyHealthcheckCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_lua.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_lua.py index acc2adc..b8533b4 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_lua.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_lua.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyLuaCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_mapfile.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_mapfile.py index 9069e67..e1be45f 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_mapfile.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_mapfile.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyMapfileCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_resolver.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_resolver.py index 6d35f6f..9dba42b 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_resolver.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_resolver.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyResolverCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_server.py b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_server.py index 24fe47b..70cb195 100644 --- a/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_server.py +++ b/opnsense_cli/commands/plugin/haproxy/tests/test_haproxy_server.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestHaproxyServerCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/commands/plugin/nodeexporter/tests/test_nodeexporter_config.py b/opnsense_cli/commands/plugin/nodeexporter/tests/test_nodeexporter_config.py index df134cd..b8f3b88 100644 --- a/opnsense_cli/commands/plugin/nodeexporter/tests/test_nodeexporter_config.py +++ b/opnsense_cli/commands/plugin/nodeexporter/tests/test_nodeexporter_config.py @@ -3,6 +3,7 @@ from opnsense_cli.commands.test_base import CommandTestCase import os + class TestNodeExporterCommands(CommandTestCase): def setUp(self): self._api_data_fixtures_reconfigure_OK = {"status": "ok"} diff --git a/opnsense_cli/formatters/cli_output/output_format_factory.py b/opnsense_cli/formatters/cli_output/output_format_factory.py index 361970e..658a028 100644 --- a/opnsense_cli/formatters/cli_output/output_format_factory.py +++ b/opnsense_cli/formatters/cli_output/output_format_factory.py @@ -1,6 +1,12 @@ from opnsense_cli.factories import ClassFromKeymapFactory -from opnsense_cli.formatters.cli_output.output_formats import ColsOutputFormat, JsonFilterOutputFormat, JsonOutputFormat, PlainOutputFormat, \ - TableOutputFormat, YamlOutputFormat +from opnsense_cli.formatters.cli_output.output_formats import ( + ColsOutputFormat, + JsonFilterOutputFormat, + JsonOutputFormat, + PlainOutputFormat, + TableOutputFormat, + YamlOutputFormat, +) class CliOutputFormatFactory(ClassFromKeymapFactory): diff --git a/opnsense_cli/formatters/cli_output/tests/test_plain_output_format.py b/opnsense_cli/formatters/cli_output/tests/test_plain_output_format.py index 25c7401..3534da9 100644 --- a/opnsense_cli/formatters/cli_output/tests/test_plain_output_format.py +++ b/opnsense_cli/formatters/cli_output/tests/test_plain_output_format.py @@ -1,6 +1,7 @@ from opnsense_cli.formatters.cli_output.output_formats import PlainOutputFormat from opnsense_cli.formatters.cli_output.tests.base import FormatTestCase + class TestPlainOutputFormat(FormatTestCase): def test_with_json_array(self): format = PlainOutputFormat(self._api_data_json_array, ["name", "version"])