Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy committed Dec 13, 2022
1 parent 2d9a51d commit c7e8916
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/cli/commands/test_config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ def setup_class(cls):
@mock.patch("airflow.cli.commands.config_command.conf")
def test_cli_show_config_should_write_data(self, mock_conf, mock_stringio):
config_command.show_config(self.parser.parse_args(["config", "list", "--color", "off"]))
mock_conf.write.assert_called_once_with(mock_stringio.return_value.__enter__.return_value)
mock_conf.write.assert_called_once_with(
mock_stringio.return_value.__enter__.return_value, section=None
)

@mock.patch("airflow.cli.commands.config_command.io.StringIO")
@mock.patch("airflow.cli.commands.config_command.conf")
def test_cli_show_config_should_write_data_specific_section(self, mock_conf, mock_stringio):
config_command.show_config(
self.parser.parse_args(["config", "list", "--section", "core", "--color", "off"])
)
mock_conf.write.assert_called_once_with(
mock_stringio.return_value.__enter__.return_value, section="core"
)

@conf_vars({("core", "testkey"): "test_value"})
def test_cli_show_config_should_display_key(self):
Expand Down

0 comments on commit c7e8916

Please sign in to comment.