Skip to content

Commit 0a91e7c

Browse files
committed
refactor: Add tests for the config path helper
1 parent 112ec35 commit 0a91e7c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/firewheel/tests/unit/cli/test_cli_configure.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,17 @@ def test_do_get_all(self, mock_stdout):
127127

128128
self.assertEqual(self.old_config, test_config)
129129

130+
@unittest.mock.patch("firewheel.cli.Config")
131+
@unittest.mock.patch("sys.stdout", new_callable=io.StringIO)
132+
def test_do_path(self, mock_stdout, mock_config_cls):
133+
mock_config_path = "/path/to/config"
134+
mock_config_cls().config_path = mock_config_path
135+
136+
args = ""
137+
self.cli.do_path(args)
138+
139+
self.assertIn(mock_config_path, mock_stdout.getvalue())
140+
130141
@unittest.mock.patch("sys.stdout", new_callable=io.StringIO)
131142
def test_do_edit_param_invalid(self, mock_stdout):
132143
args = "-e asdf"

0 commit comments

Comments
 (0)