Skip to content

Commit d419981

Browse files
committed
Test manage-cookie update with and without updates to apply
1 parent 54491c0 commit d419981

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_manage_cookie.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def environ() -> Iterator[None]:
3030
yield
3131

3232

33-
@pytest.fixture
34-
def new_cookie(environ: None, temp_dir: str) -> Iterator[Path]:
33+
@pytest.fixture(params=["@"])
34+
def new_cookie(
35+
request: pytest.FixtureRequest, environ: None, temp_dir: str
36+
) -> Iterator[Path]:
3537
project_name = "unit-test-1"
3638
testargs = [
3739
"new-cookie",
@@ -51,7 +53,7 @@ def new_cookie(environ: None, temp_dir: str) -> Iterator[Path]:
5153
}
5254
),
5355
"-c",
54-
"f2f7eddb101275f2909525e579e0ed6f3b5305fa",
56+
request.param,
5557
]
5658
with patch.object(sys, "argv", testargs):
5759
new_cookie_main()
@@ -65,6 +67,12 @@ def new_cookie(environ: None, temp_dir: str) -> Iterator[Path]:
6567
yield project_dir
6668

6769

70+
@pytest.mark.parametrize(
71+
"new_cookie",
72+
("@", "f2f7eddb101275f2909525e579e0ed6f3b5305fa"),
73+
ids=["no_updates", "updates"],
74+
indirect=True,
75+
)
6876
def test_manage_cookie_update(new_cookie: str) -> None:
6977
testargs = ["manage-cookie", "update", str(new_cookie), "-p"]
7078
with patch.object(sys, "argv", testargs):

0 commit comments

Comments
 (0)