Skip to content

Commit

Permalink
Add: checks whether default_arguments/args are of type list
Browse files Browse the repository at this point in the history
  • Loading branch information
Balou9 authored and greenbonebot committed Jul 24, 2024
1 parent 65900b0 commit 7c7626c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_ruff.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_get_ruff_config(
def test_get_default_ruff_arguments(self):
args = get_ruff_arguments(None)
self.assertEqual(args, DEFAULT_ARGUMENTS)
self.assertIsInstance(args, list, "ensures args is a list")

@patch("autohooks.plugins.ruff.ruff.get_ruff_config")
def test_get_ruff_arguments(
Expand All @@ -67,7 +68,9 @@ def test_get_ruff_arguments(
.get_config()
.get("tool", "autohooks", "plugins", "ruff")
)
self.assertIsInstance(args, list, "ensures args is a list")
self.assertEqual(args, ["--test", "foo,bar", "--foo", "bar"])

_get_ruff_config.assert_not_called()

@patch("autohooks.plugins.ruff.ruff.get_staged_status")
Expand Down

0 comments on commit 7c7626c

Please sign in to comment.